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

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

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/profiles/profile_downloader.h" 10 #include "chrome/browser/profiles/profile_downloader.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 gfx::Image gaia_picture = gfx::test::CreateImage(); 177 gfx::Image gaia_picture = gfx::test::CreateImage();
178 GetCache()->SetGAIAPictureOfProfileAtIndex(0, &gaia_picture); 178 GetCache()->SetGAIAPictureOfProfileAtIndex(0, &gaia_picture);
179 179
180 // Set a fake picture URL. 180 // Set a fake picture URL.
181 profile()->GetPrefs()->SetString(prefs::kProfileGAIAInfoPictureURL, 181 profile()->GetPrefs()->SetString(prefs::kProfileGAIAInfoPictureURL,
182 "example.com"); 182 "example.com");
183 183
184 GAIAInfoUpdateService service(profile()); 184 GAIAInfoUpdateService service(profile());
185 EXPECT_FALSE(service.GetCachedPictureURL().empty()); 185 EXPECT_FALSE(service.GetCachedPictureURL().empty());
186 // Log out. 186 // Log out.
187 profile()->GetPrefs()->SetString(prefs::kGoogleServicesUsername, ""); 187 profile()->GetPrefs()
188 ->SetString(prefs::kGoogleServicesUsername, std::string());
188 189
189 // Verify that the GAIA name and picture, and picture URL are unset. 190 // Verify that the GAIA name and picture, and picture URL are unset.
190 EXPECT_TRUE(GetCache()->GetGAIANameOfProfileAtIndex(0).empty()); 191 EXPECT_TRUE(GetCache()->GetGAIANameOfProfileAtIndex(0).empty());
191 EXPECT_EQ(NULL, GetCache()->GetGAIAPictureOfProfileAtIndex(0)); 192 EXPECT_EQ(NULL, GetCache()->GetGAIAPictureOfProfileAtIndex(0));
192 EXPECT_TRUE(service.GetCachedPictureURL().empty()); 193 EXPECT_TRUE(service.GetCachedPictureURL().empty());
193 } 194 }
194 195
195 TEST_F(GAIAInfoUpdateServiceTest, LogIn) { 196 TEST_F(GAIAInfoUpdateServiceTest, LogIn) {
196 profile()->GetPrefs()->SetString(prefs::kGoogleServicesUsername, ""); 197 profile()->GetPrefs()
198 ->SetString(prefs::kGoogleServicesUsername, std::string());
197 GAIAInfoUpdateServiceMock service(profile()); 199 GAIAInfoUpdateServiceMock service(profile());
198 200
199 // Log in. 201 // Log in.
200 EXPECT_CALL(service, Update()); 202 EXPECT_CALL(service, Update());
201 profile()->GetPrefs()->SetString(prefs::kGoogleServicesUsername, 203 profile()->GetPrefs()->SetString(prefs::kGoogleServicesUsername,
202 "pat@example.com"); 204 "pat@example.com");
203 } 205 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/gaia_info_update_service_factory.cc ('k') | chrome/browser/profiles/profile_downloader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698