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

Side by Side Diff: chrome/browser/profiles/gaia_info_update_service_unittest.cc

Issue 8743007: Enable GAIA profile info downloader by default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/profiles/gaia_info_update_service.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/profiles/gaia_info_update_service.h" 5 #include "chrome/browser/profiles/gaia_info_update_service.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/prefs/pref_service.h" 9 #include "chrome/browser/prefs/pref_service.h"
10 #include "chrome/browser/profiles/profile_info_cache_unittest.h" 10 #include "chrome/browser/profiles/profile_info_cache_unittest.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 EXPECT_TRUE(GetCache()->GetHasMigratedToGAIAInfoOfProfileAtIndex(index)); 130 EXPECT_TRUE(GetCache()->GetHasMigratedToGAIAInfoOfProfileAtIndex(index));
131 EXPECT_EQ(old_name, GetCache()->GetNameOfProfileAtIndex(index)); 131 EXPECT_EQ(old_name, GetCache()->GetNameOfProfileAtIndex(index));
132 EXPECT_EQ(new_name, GetCache()->GetGAIANameOfProfileAtIndex(index)); 132 EXPECT_EQ(new_name, GetCache()->GetGAIANameOfProfileAtIndex(index));
133 EXPECT_TRUE(gfx::test::IsEqual( 133 EXPECT_TRUE(gfx::test::IsEqual(
134 old_image, GetCache()->GetAvatarIconOfProfileAtIndex(index))); 134 old_image, GetCache()->GetAvatarIconOfProfileAtIndex(index)));
135 EXPECT_TRUE(gfx::test::IsEqual( 135 EXPECT_TRUE(gfx::test::IsEqual(
136 new_image, *GetCache()->GetGAIAPictureOfProfileAtIndex(index))); 136 new_image, *GetCache()->GetGAIAPictureOfProfileAtIndex(index)));
137 } 137 }
138 138
139 TEST_F(GAIAInfoUpdateServiceTest, ShouldUseGAIAProfileInfo) { 139 TEST_F(GAIAInfoUpdateServiceTest, ShouldUseGAIAProfileInfo) {
140 // Currently this is disabled by default. 140 bool sync_enabled = profile()->GetOriginalProfile()->IsSyncAccessible();
141 EXPECT_FALSE(GAIAInfoUpdateService::ShouldUseGAIAProfileInfo(profile())); 141 EXPECT_EQ(sync_enabled,
142 GAIAInfoUpdateService::ShouldUseGAIAProfileInfo(profile()));
142 } 143 }
143 144
144 TEST_F(GAIAInfoUpdateServiceTest, ScheduleUpdate) { 145 TEST_F(GAIAInfoUpdateServiceTest, ScheduleUpdate) {
145 GAIAInfoUpdateService service(profile()); 146 GAIAInfoUpdateService service(profile());
146 EXPECT_TRUE(service.timer_.IsRunning()); 147 EXPECT_TRUE(service.timer_.IsRunning());
147 service.timer_.Stop(); 148 service.timer_.Stop();
148 EXPECT_FALSE(service.timer_.IsRunning()); 149 EXPECT_FALSE(service.timer_.IsRunning());
149 service.ScheduleNextUpdate(); 150 service.ScheduleNextUpdate();
150 EXPECT_TRUE(service.timer_.IsRunning()); 151 EXPECT_TRUE(service.timer_.IsRunning());
151 } 152 }
(...skipping 17 matching lines...) Expand all
169 170
170 TEST_F(GAIAInfoUpdateServiceTest, LogIn) { 171 TEST_F(GAIAInfoUpdateServiceTest, LogIn) {
171 profile()->GetPrefs()->SetString(prefs::kGoogleServicesUsername, ""); 172 profile()->GetPrefs()->SetString(prefs::kGoogleServicesUsername, "");
172 GAIAInfoUpdateServiceMock service(profile()); 173 GAIAInfoUpdateServiceMock service(profile());
173 174
174 // Log in. 175 // Log in.
175 EXPECT_CALL(service, Update()); 176 EXPECT_CALL(service, Update());
176 profile()->GetPrefs()->SetString(prefs::kGoogleServicesUsername, 177 profile()->GetPrefs()->SetString(prefs::kGoogleServicesUsername,
177 "pat@example.com"); 178 "pat@example.com");
178 } 179 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/gaia_info_update_service.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698