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

Unified Diff: chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_unittest.cc

Issue 1497973002: This CL replaces e-mail with AccountId in wallpaper manager code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update after review. Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_unittest.cc
diff --git a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_unittest.cc b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_unittest.cc
index ca42bdecd0ececbafa363e537a9947e8be907bda..5d6caf31217202f500d2aa559772b30b6d3346bf 100644
--- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_unittest.cc
+++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_unittest.cc
@@ -95,36 +95,30 @@ TEST_F(WallpaperManagerCacheTest, VerifyWallpaperCache) {
gfx::ImageSkia test_user_1_wallpaper = CreateTestImage(SK_ColorRED);
gfx::ImageSkia test_user_2_wallpaper = CreateTestImage(SK_ColorGREEN);
gfx::ImageSkia test_user_3_wallpaper = CreateTestImage(SK_ColorWHITE);
- test_api->SetWallpaperCache(test_account_id_1.GetUserEmail(), path1,
- test_user_1_wallpaper);
- test_api->SetWallpaperCache(test_account_id_2.GetUserEmail(), path2,
- test_user_2_wallpaper);
- test_api->SetWallpaperCache(test_account_id_3.GetUserEmail(), path3,
- test_user_3_wallpaper);
+ test_api->SetWallpaperCache(test_account_id_1, path1, test_user_1_wallpaper);
+ test_api->SetWallpaperCache(test_account_id_2, path2, test_user_2_wallpaper);
+ test_api->SetWallpaperCache(test_account_id_3, path3, test_user_3_wallpaper);
test_api->ClearDisposableWallpaperCache();
gfx::ImageSkia cached_wallpaper;
- EXPECT_TRUE(test_api->GetWallpaperFromCache(test_account_id_1.GetUserEmail(),
- &cached_wallpaper));
- base::FilePath path;
EXPECT_TRUE(
- test_api->GetPathFromCache(test_account_id_1.GetUserEmail(), &path));
+ test_api->GetWallpaperFromCache(test_account_id_1, &cached_wallpaper));
+ base::FilePath path;
+ EXPECT_TRUE(test_api->GetPathFromCache(test_account_id_1, &path));
// Logged in users' wallpaper cache should be kept.
EXPECT_TRUE(cached_wallpaper.BackedBySameObjectAs(test_user_1_wallpaper));
EXPECT_EQ(path, path1);
- EXPECT_TRUE(test_api->GetWallpaperFromCache(test_account_id_2.GetUserEmail(),
- &cached_wallpaper));
EXPECT_TRUE(
- test_api->GetPathFromCache(test_account_id_2.GetUserEmail(), &path));
+ test_api->GetWallpaperFromCache(test_account_id_2, &cached_wallpaper));
+ EXPECT_TRUE(test_api->GetPathFromCache(test_account_id_2, &path));
EXPECT_TRUE(cached_wallpaper.BackedBySameObjectAs(test_user_2_wallpaper));
EXPECT_EQ(path, path2);
// Not logged in user's wallpaper cache should be cleared.
- EXPECT_FALSE(test_api->GetWallpaperFromCache(test_account_id_3.GetUserEmail(),
- &cached_wallpaper));
EXPECT_FALSE(
- test_api->GetPathFromCache(test_account_id_3.GetUserEmail(), &path));
+ test_api->GetWallpaperFromCache(test_account_id_3, &cached_wallpaper));
+ EXPECT_FALSE(test_api->GetPathFromCache(test_account_id_3, &path));
}
// Test that the user's wallpaper cache is cleared after the user is removed.
@@ -143,26 +137,24 @@ TEST_F(WallpaperManagerCacheTest, CacheClearedOnUserRemoval) {
const gfx::ImageSkia test_user_1_wallpaper = CreateTestImage(SK_ColorRED);
const gfx::ImageSkia test_user_2_wallpaper = CreateTestImage(SK_ColorGREEN);
- test_api->SetWallpaperCache(test_account_id_1.GetUserEmail(), path1,
- test_user_1_wallpaper);
- test_api->SetWallpaperCache(test_account_id_2.GetUserEmail(), path2,
- test_user_2_wallpaper);
+ test_api->SetWallpaperCache(test_account_id_1, path1, test_user_1_wallpaper);
+ test_api->SetWallpaperCache(test_account_id_2, path2, test_user_2_wallpaper);
gfx::ImageSkia cached_wallpaper;
// Test that both user1 and user2's wallpaper can be found in cache.
- EXPECT_TRUE(test_api->GetWallpaperFromCache(test_account_id_1.GetUserEmail(),
- &cached_wallpaper));
- EXPECT_TRUE(test_api->GetWallpaperFromCache(test_account_id_2.GetUserEmail(),
- &cached_wallpaper));
+ EXPECT_TRUE(
+ test_api->GetWallpaperFromCache(test_account_id_1, &cached_wallpaper));
+ EXPECT_TRUE(
+ test_api->GetWallpaperFromCache(test_account_id_2, &cached_wallpaper));
// Remove user2.
fake_user_manager()->RemoveUserFromList(test_account_id_2);
// Test that only user1's wallpaper can be found in cache.
- EXPECT_TRUE(test_api->GetWallpaperFromCache(test_account_id_1.GetUserEmail(),
- &cached_wallpaper));
- EXPECT_FALSE(test_api->GetWallpaperFromCache(test_account_id_2.GetUserEmail(),
- &cached_wallpaper));
+ EXPECT_TRUE(
+ test_api->GetWallpaperFromCache(test_account_id_1, &cached_wallpaper));
+ EXPECT_FALSE(
+ test_api->GetWallpaperFromCache(test_account_id_2, &cached_wallpaper));
}
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698