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

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

Issue 196473015: [Profiles] Don't treat GAIA names differently than regular profile names. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove useless comment Created 6 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 side-by-side diff with in-line comments
Download patch
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 5aa1d7ec6bd84bb6504e260a43189f72b97c253f..1eacf5b3e089bc3be8a1ea55048b8b790e50048f 100644
--- a/chrome/browser/profiles/gaia_info_update_service_unittest.cc
+++ b/chrome/browser/profiles/gaia_info_update_service_unittest.cc
@@ -95,8 +95,6 @@ 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(
@@ -119,7 +117,6 @@ TEST_F(GAIAInfoUpdateServiceTest, DownloadFailure) {
ProfileDownloaderDelegate::SERVICE_ERROR);
// On failure nothing should be updated.
- EXPECT_FALSE(GetCache()->GetHasMigratedToGAIAInfoOfProfileAtIndex(index));
EXPECT_EQ(old_name, GetCache()->GetNameOfProfileAtIndex(index));
EXPECT_EQ(base::string16(), GetCache()->GetGAIANameOfProfileAtIndex(index));
EXPECT_TRUE(gfx::test::IsEqual(
@@ -128,38 +125,6 @@ TEST_F(GAIAInfoUpdateServiceTest, DownloadFailure) {
EXPECT_EQ(std::string(), service.GetCachedPictureURL());
}
-TEST_F(GAIAInfoUpdateServiceTest, NoMigration) {
- size_t index = GetCache()->GetIndexOfProfileWithPath(profile()->GetPath());
- base::string16 old_name = GetCache()->GetNameOfProfileAtIndex(index);
- gfx::Image old_image = GetCache()->GetAvatarIconOfProfileAtIndex(index);
-
- // Mark the profile as migrated.
- GetCache()->SetHasMigratedToGAIAInfoOfProfileAtIndex(index, true);
-
- GAIAInfoUpdateService service(profile());
- NiceMock<ProfileDownloaderMock> downloader(&service);
- base::string16 new_name = base::ASCIIToUTF16("Pat Smith");
- EXPECT_CALL(downloader, GetProfileFullName()).WillOnce(Return(new_name));
- gfx::Image new_image = gfx::test::CreateImage();
- const SkBitmap* new_bmp = new_image.ToSkBitmap();
- EXPECT_CALL(downloader, GetProfilePicture()).WillOnce(Return(*new_bmp));
- EXPECT_CALL(downloader, GetProfilePictureStatus()).
- WillOnce(Return(ProfileDownloader::PICTURE_SUCCESS));
- EXPECT_CALL(downloader, GetProfilePictureURL()).WillOnce(Return(""));
-
- service.OnProfileDownloadSuccess(&downloader);
-
- // On success with no migration the profile info should not be updated but
- // the GAIA info should be updated.
- EXPECT_TRUE(GetCache()->GetHasMigratedToGAIAInfoOfProfileAtIndex(index));
- EXPECT_EQ(old_name, GetCache()->GetNameOfProfileAtIndex(index));
- EXPECT_EQ(new_name, GetCache()->GetGAIANameOfProfileAtIndex(index));
- EXPECT_TRUE(gfx::test::IsEqual(
- old_image, GetCache()->GetAvatarIconOfProfileAtIndex(index)));
- EXPECT_TRUE(gfx::test::IsEqual(
- new_image, *GetCache()->GetGAIAPictureOfProfileAtIndex(index)));
-}
-
TEST_F(GAIAInfoUpdateServiceTest, ShouldUseGAIAProfileInfo) {
#if defined(OS_CHROMEOS)
// This feature should never be enabled on ChromeOS.

Powered by Google App Engine
This is Rietveld 408576698