OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/sync/sync_error_notifier_ash.h" | 5 #include "chrome/browser/sync/sync_error_notifier_ash.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 public: | 82 public: |
83 SyncErrorNotifierTest() {} | 83 SyncErrorNotifierTest() {} |
84 ~SyncErrorNotifierTest() override {} | 84 ~SyncErrorNotifierTest() override {} |
85 | 85 |
86 void SetUp() override { | 86 void SetUp() override { |
87 DCHECK(TestingBrowserProcess::GetGlobal()); | 87 DCHECK(TestingBrowserProcess::GetGlobal()); |
88 | 88 |
89 // Set up a desktop screen for Windows to hold native widgets, used when | 89 // Set up a desktop screen for Windows to hold native widgets, used when |
90 // adding desktop widgets (i.e., message center notifications). | 90 // adding desktop widgets (i.e., message center notifications). |
91 #if defined(OS_WIN) | 91 #if defined(OS_WIN) |
92 test_screen_.reset(aura::TestScreen::Create(gfx::Size())); | 92 test_screen_ = base::MakeUnique<aura::TestScreen::Create>(gfx::Size()); |
93 display::Screen::SetScreenInstance(test_screen_.get()); | 93 display::Screen::SetScreenInstance(test_screen_.get()); |
94 #endif | 94 #endif |
95 | 95 |
96 AshTestBase::SetUp(); | 96 AshTestBase::SetUp(); |
97 | 97 |
98 profile_manager_.reset( | 98 profile_manager_ = base::MakeUnique<TestingProfileManager>( |
99 new TestingProfileManager(TestingBrowserProcess::GetGlobal())); | 99 TestingBrowserProcess::GetGlobal()); |
100 ASSERT_TRUE(profile_manager_->SetUp()); | 100 ASSERT_TRUE(profile_manager_->SetUp()); |
101 | 101 |
102 profile_ = profile_manager_->CreateTestingProfile(kTestAccountId); | 102 profile_ = profile_manager_->CreateTestingProfile(kTestAccountId); |
103 | 103 |
104 service_.reset(new browser_sync::ProfileSyncServiceMock( | 104 service_ = base::MakeUnique<browser_sync::ProfileSyncServiceMock>( |
105 CreateProfileSyncServiceParamsForTest(profile_))); | 105 CreateProfileSyncServiceParamsForTest(profile_)); |
106 | 106 |
107 FakeLoginUIService* login_ui_service = static_cast<FakeLoginUIService*>( | 107 FakeLoginUIService* login_ui_service = static_cast<FakeLoginUIService*>( |
108 LoginUIServiceFactory::GetInstance()->SetTestingFactoryAndUse( | 108 LoginUIServiceFactory::GetInstance()->SetTestingFactoryAndUse( |
109 profile_, BuildMockLoginUIService)); | 109 profile_, BuildMockLoginUIService)); |
110 login_ui_service->SetLoginUI(&login_ui_); | 110 login_ui_service->SetLoginUI(&login_ui_); |
111 | 111 |
112 error_controller_.reset(new syncer::SyncErrorController(service_.get())); | 112 error_controller_ = |
113 error_notifier_.reset(new SyncErrorNotifier(error_controller_.get(), | 113 base::MakeUnique<syncer::SyncErrorController>(service_.get()); |
114 profile_)); | 114 error_notifier_ = |
| 115 base::MakeUnique<SyncErrorNotifier>(error_controller_.get(), profile_); |
115 | 116 |
116 notification_ui_manager_ = g_browser_process->notification_ui_manager(); | 117 notification_ui_manager_ = g_browser_process->notification_ui_manager(); |
117 } | 118 } |
118 | 119 |
119 void TearDown() override { | 120 void TearDown() override { |
120 error_notifier_->Shutdown(); | 121 error_notifier_->Shutdown(); |
121 service_.reset(); | 122 service_.reset(); |
122 profile_manager_.reset(); | 123 profile_manager_.reset(); |
123 | 124 |
124 AshTestBase::TearDown(); | 125 AshTestBase::TearDown(); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 SCOPED_TRACE("Not expecting notification since sync setup is incomplete"); | 228 SCOPED_TRACE("Not expecting notification since sync setup is incomplete"); |
228 VerifySyncErrorNotifierResult( | 229 VerifySyncErrorNotifierResult( |
229 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, | 230 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, |
230 false /* not signed in */, | 231 false /* not signed in */, |
231 false /* no error */); | 232 false /* no error */); |
232 } | 233 } |
233 } | 234 } |
234 | 235 |
235 } // namespace test | 236 } // namespace test |
236 } // namespace ash | 237 } // namespace ash |
OLD | NEW |