Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: chrome/browser/sync/sync_error_notifier_ash_unittest.cc

Issue 845373002: Change default code flag to NewAvatarMenu. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test comment. GetAvatarIcon's no longer const. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/files/file_util.h"
8 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/notifications/notification.h" 11 #include "chrome/browser/notifications/notification.h"
11 #include "chrome/browser/notifications/notification_ui_manager.h" 12 #include "chrome/browser/notifications/notification_ui_manager.h"
13 #include "chrome/browser/profiles/profile_avatar_icon_util.h"
14 #include "chrome/browser/profiles/profile_info_cache.h"
12 #include "chrome/browser/sync/profile_sync_service_mock.h" 15 #include "chrome/browser/sync/profile_sync_service_mock.h"
13 #include "chrome/browser/sync/sync_error_controller.h" 16 #include "chrome/browser/sync/sync_error_controller.h"
14 #include "chrome/browser/ui/browser.h" 17 #include "chrome/browser/ui/browser.h"
15 #include "chrome/browser/ui/webui/signin/login_ui_service.h" 18 #include "chrome/browser/ui/webui/signin/login_ui_service.h"
16 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" 19 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
17 #include "chrome/test/base/testing_browser_process.h" 20 #include "chrome/test/base/testing_browser_process.h"
18 #include "chrome/test/base/testing_profile.h" 21 #include "chrome/test/base/testing_profile.h"
19 #include "chrome/test/base/testing_profile_manager.h" 22 #include "chrome/test/base/testing_profile_manager.h"
20 #include "testing/gmock/include/gmock/gmock.h" 23 #include "testing/gmock/include/gmock/gmock.h"
21 #include "testing/gtest/include/gtest/gtest.h" 24 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 SyncErrorNotifierTest() {} 96 SyncErrorNotifierTest() {}
94 ~SyncErrorNotifierTest() override {} 97 ~SyncErrorNotifierTest() override {}
95 98
96 void SetUp() override { 99 void SetUp() override {
97 profile_manager_.reset( 100 profile_manager_.reset(
98 new TestingProfileManager(TestingBrowserProcess::GetGlobal())); 101 new TestingProfileManager(TestingBrowserProcess::GetGlobal()));
99 ASSERT_TRUE(profile_manager_->SetUp()); 102 ASSERT_TRUE(profile_manager_->SetUp());
100 103
101 profile_ = profile_manager_->CreateTestingProfile(kTestAccountId); 104 profile_ = profile_manager_->CreateTestingProfile(kTestAccountId);
102 105
106 #if !defined(OS_CHROMEOS)
107 // Preload the desktop avatar icon so it's cached for the test's execution.
108 ProfileInfoCache& cache = *profile_manager_->profile_info_cache();
109 size_t index = cache.GetIndexOfProfileWithPath(profile_->GetPath());
110 cache.GetAvatarIconOfProfileAtIndex(index);
111 base::MessageLoop::current()->RunUntilIdle();
112 ASSERT_TRUE(base::PathExists(profiles::GetPathOfHighResAvatarAtIndex(
113 cache.GetAvatarIconIndexOfProfileAtIndex(index))));
114 #endif
115
103 TestingBrowserProcess::GetGlobal(); 116 TestingBrowserProcess::GetGlobal();
104 AshTestBase::SetUp(); 117 AshTestBase::SetUp();
105 118
106 // Set up a desktop screen for Windows to hold native widgets, used when 119 // Set up a desktop screen for Windows to hold native widgets, used when
107 // adding desktop widgets (i.e., message center notifications). 120 // adding desktop widgets (i.e., message center notifications).
108 #if defined(OS_WIN) 121 #if defined(OS_WIN)
109 test_screen_.reset(aura::TestScreen::Create(gfx::Size())); 122 test_screen_.reset(aura::TestScreen::Create(gfx::Size()));
110 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_.get()); 123 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_.get());
111 gfx::Screen::SetScreenTypeDelegate(&screen_type_delegate_); 124 gfx::Screen::SetScreenTypeDelegate(&screen_type_delegate_);
112 #endif 125 #endif
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 SCOPED_TRACE("Not expecting notification since sync setup is incomplete"); 245 SCOPED_TRACE("Not expecting notification since sync setup is incomplete");
233 VerifySyncErrorNotifierResult( 246 VerifySyncErrorNotifierResult(
234 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, 247 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS,
235 false /* not signed in */, 248 false /* not signed in */,
236 false /* no error */); 249 false /* no error */);
237 } 250 }
238 } 251 }
239 252
240 } // namespace test 253 } // namespace test
241 } // namespace ash 254 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698