| 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 ac00c1d6535feac451c78304e365871a7609429e..9c9f6154f958db9ac4bb7739d02cfb3455b0015b 100644
|
| --- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_unittest.cc
|
| +++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_unittest.cc
|
| @@ -72,22 +72,19 @@
|
|
|
| TEST_F(WallpaperManagerCacheTest, VerifyWallpaperCache) {
|
| // Add three users to known users.
|
| - const AccountId test_account_id_1 =
|
| - AccountId::FromUserEmail("test1@example.com");
|
| - const AccountId test_account_id_2 =
|
| - AccountId::FromUserEmail("test2@example.com");
|
| - const AccountId test_account_id_3 =
|
| - AccountId::FromUserEmail("test3@example.com");
|
| + std::string test_user_1 = "test1@example.com";
|
| + std::string test_user_2 = "test2@example.com";
|
| + std::string test_user_3 = "test3@example.com";
|
| base::FilePath path1("path1");
|
| base::FilePath path2("path2");
|
| base::FilePath path3("path3");
|
| - fake_user_manager()->AddUser(test_account_id_1);
|
| - fake_user_manager()->AddUser(test_account_id_2);
|
| - fake_user_manager()->AddUser(test_account_id_3);
|
| + fake_user_manager()->AddUser(test_user_1);
|
| + fake_user_manager()->AddUser(test_user_2);
|
| + fake_user_manager()->AddUser(test_user_3);
|
|
|
| // Login two users.
|
| - fake_user_manager()->LoginUser(test_account_id_1);
|
| - fake_user_manager()->LoginUser(test_account_id_2);
|
| + fake_user_manager()->LoginUser(test_user_1);
|
| + fake_user_manager()->LoginUser(test_user_2);
|
|
|
| scoped_ptr<WallpaperManager::TestApi> test_api;
|
| test_api.reset(new WallpaperManager::TestApi(WallpaperManager::Get()));
|
| @@ -95,36 +92,27 @@
|
| 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_user_1, path1, test_user_1_wallpaper);
|
| + test_api->SetWallpaperCache(test_user_2, path2, test_user_2_wallpaper);
|
| + test_api->SetWallpaperCache(test_user_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));
|
| + EXPECT_TRUE(test_api->GetWallpaperFromCache(test_user_1, &cached_wallpaper));
|
| base::FilePath path;
|
| - EXPECT_TRUE(
|
| - test_api->GetPathFromCache(test_account_id_1.GetUserEmail(), &path));
|
| + EXPECT_TRUE(test_api->GetPathFromCache(test_user_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));
|
| + EXPECT_TRUE(test_api->GetWallpaperFromCache(test_user_2, &cached_wallpaper));
|
| + EXPECT_TRUE(test_api->GetPathFromCache(test_user_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));
|
| + EXPECT_FALSE(test_api->GetWallpaperFromCache(test_user_3, &cached_wallpaper));
|
| + EXPECT_FALSE(test_api->GetPathFromCache(test_user_3, &path));
|
| }
|
|
|
| } // namespace chromeos
|
|
|