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 "ash/test/ash_test_base.h" | 7 #include "ash/test/ash_test_base.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/notifications/notification.h" | 10 #include "chrome/browser/notifications/notification.h" |
11 #include "chrome/browser/notifications/notification_ui_manager.h" | 11 #include "chrome/browser/notifications/notification_ui_manager.h" |
12 #include "chrome/browser/profiles/profile_info_cache.h" | |
12 #include "chrome/browser/sync/profile_sync_service_mock.h" | 13 #include "chrome/browser/sync/profile_sync_service_mock.h" |
13 #include "chrome/browser/sync/sync_error_controller.h" | 14 #include "chrome/browser/sync/sync_error_controller.h" |
14 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
15 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 16 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
16 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 17 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
17 #include "chrome/test/base/testing_browser_process.h" | 18 #include "chrome/test/base/testing_browser_process.h" |
18 #include "chrome/test/base/testing_profile.h" | 19 #include "chrome/test/base/testing_profile.h" |
19 #include "chrome/test/base/testing_profile_manager.h" | 20 #include "chrome/test/base/testing_profile_manager.h" |
20 #include "testing/gmock/include/gmock/gmock.h" | 21 #include "testing/gmock/include/gmock/gmock.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
93 SyncErrorNotifierTest() {} | 94 SyncErrorNotifierTest() {} |
94 ~SyncErrorNotifierTest() override {} | 95 ~SyncErrorNotifierTest() override {} |
95 | 96 |
96 void SetUp() override { | 97 void SetUp() override { |
97 profile_manager_.reset( | 98 profile_manager_.reset( |
98 new TestingProfileManager(TestingBrowserProcess::GetGlobal())); | 99 new TestingProfileManager(TestingBrowserProcess::GetGlobal())); |
99 ASSERT_TRUE(profile_manager_->SetUp()); | 100 ASSERT_TRUE(profile_manager_->SetUp()); |
100 | 101 |
101 profile_ = profile_manager_->CreateTestingProfile(kTestAccountId); | 102 profile_ = profile_manager_->CreateTestingProfile(kTestAccountId); |
102 | 103 |
104 // Preload the avatar icon so it's cached for the test's execution. | |
105 ProfileInfoCache& cache = *profile_manager_->profile_info_cache(); | |
106 cache.GetAvatarIconOfProfileAtIndex( | |
107 cache.GetIndexOfProfileWithPath(profile_->GetPath())); | |
108 base::MessageLoop::current()->RunUntilIdle(); | |
noms (inactive)
2015/03/17 14:26:30
Should you have an assert after the MessageLoop bi
Mike Lerman
2015/03/18 19:29:48
Done.
| |
109 | |
103 TestingBrowserProcess::GetGlobal(); | 110 TestingBrowserProcess::GetGlobal(); |
104 AshTestBase::SetUp(); | 111 AshTestBase::SetUp(); |
105 | 112 |
106 // Set up a desktop screen for Windows to hold native widgets, used when | 113 // Set up a desktop screen for Windows to hold native widgets, used when |
107 // adding desktop widgets (i.e., message center notifications). | 114 // adding desktop widgets (i.e., message center notifications). |
108 #if defined(OS_WIN) | 115 #if defined(OS_WIN) |
109 test_screen_.reset(aura::TestScreen::Create(gfx::Size())); | 116 test_screen_.reset(aura::TestScreen::Create(gfx::Size())); |
110 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_.get()); | 117 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_.get()); |
111 gfx::Screen::SetScreenTypeDelegate(&screen_type_delegate_); | 118 gfx::Screen::SetScreenTypeDelegate(&screen_type_delegate_); |
112 #endif | 119 #endif |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
232 SCOPED_TRACE("Not expecting notification since sync setup is incomplete"); | 239 SCOPED_TRACE("Not expecting notification since sync setup is incomplete"); |
233 VerifySyncErrorNotifierResult( | 240 VerifySyncErrorNotifierResult( |
234 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, | 241 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, |
235 false /* not signed in */, | 242 false /* not signed in */, |
236 false /* no error */); | 243 false /* no error */); |
237 } | 244 } |
238 } | 245 } |
239 | 246 |
240 } // namespace test | 247 } // namespace test |
241 } // namespace ash | 248 } // namespace ash |
OLD | NEW |