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

Unified Diff: chrome/browser/profiles/gaia_info_update_service_unittest.cc

Issue 186803003: Use custom profile names (if available) for signed in profiles (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_info_cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/gaia_info_update_service_unittest.cc
diff --git a/chrome/browser/profiles/gaia_info_update_service_unittest.cc b/chrome/browser/profiles/gaia_info_update_service_unittest.cc
index e4c04d707220d61aa987912479e7fd662a9835fd..5aa1d7ec6bd84bb6504e260a43189f72b97c253f 100644
--- a/chrome/browser/profiles/gaia_info_update_service_unittest.cc
+++ b/chrome/browser/profiles/gaia_info_update_service_unittest.cc
@@ -57,8 +57,14 @@ class GAIAInfoUpdateServiceTest : public ProfileInfoCacheTest {
}
Profile* profile() {
- if (!profile_)
- profile_ = testing_profile_manager_.CreateTestingProfile("profile_1");
+ if (!profile_) {
+ profile_ = testing_profile_manager_.CreateTestingProfile("Person 1");
+ // The testing manager sets the profile name manually, which counts as
+ // a user-customized profile name. Reset this to match the default name
+ // we are actually using.
+ size_t index = GetCache()->GetIndexOfProfileWithPath(profile_->GetPath());
+ GetCache()->SetProfileIsUsingDefaultNameAtIndex(index, true);
+ }
return profile_;
}
@@ -90,6 +96,7 @@ TEST_F(GAIAInfoUpdateServiceTest, DownloadSuccess) {
// On success both the profile info and GAIA info should be updated.
size_t index = GetCache()->GetIndexOfProfileWithPath(profile()->GetPath());
EXPECT_TRUE(GetCache()->GetHasMigratedToGAIAInfoOfProfileAtIndex(index));
+ EXPECT_TRUE(GetCache()->IsUsingGAIANameOfProfileAtIndex(index));
EXPECT_EQ(name, GetCache()->GetNameOfProfileAtIndex(index));
EXPECT_EQ(name, GetCache()->GetGAIANameOfProfileAtIndex(index));
EXPECT_TRUE(gfx::test::IsEqual(
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_info_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698