Index: chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.cc |
diff --git a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.cc b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.cc |
index 448d058ef3d93cd4cd34dd22f150bdc9b78c06c0..1fa6cd4c310bebc840ef78e87478a449a8485f24 100644 |
--- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.cc |
+++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.cc |
@@ -110,20 +110,19 @@ class WallpaperManagerBrowserTest : public InProcessBrowserTest { |
return wallpaper_path; |
} |
- // Logs in |username|. |
- void LogIn(const std::string& username, const std::string& username_hash) { |
- user_manager::UserManager::Get()->UserLoggedIn( |
- username, username_hash, false); |
+ // Logs in |user_id|. |
+ void LogIn(const AccountId& user_id, const std::string& user_id_hash) { |
+ user_manager::UserManager::Get()->UserLoggedIn(user_id, user_id_hash, |
+ false); |
WaitAsyncWallpaperLoadStarted(); |
} |
- // Logs in |username| and sets it as child account. |
- void LogInAsChild( |
- const std::string& username, const std::string& username_hash) { |
- user_manager::UserManager::Get()->UserLoggedIn( |
- username, username_hash, false); |
+ // Logs in |user_id| and sets it as child account. |
+ void LogInAsChild(const AccountId& user_id, const std::string& user_id_hash) { |
+ user_manager::UserManager::Get()->UserLoggedIn(user_id, user_id_hash, |
+ false); |
user_manager::User* user = |
- user_manager::UserManager::Get()->FindUserAndModify(username); |
+ user_manager::UserManager::Get()->FindUserAndModify(user_id); |
user_manager::UserManager::Get()->ChangeUserChildStatus( |
user, true /* is_child */); |
} |
@@ -168,7 +167,7 @@ class WallpaperManagerBrowserTest : public InProcessBrowserTest { |
IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, |
LoadCustomLargeWallpaperForLargeExternalScreen) { |
WallpaperManager* wallpaper_manager = WallpaperManager::Get(); |
- LogIn(kTestUser1, kTestUser1Hash); |
+ LogIn(AccountId::FromUserEmail(kTestUser1), kTestUser1Hash); |
std::string id = base::Int64ToString(base::Time::Now().ToInternalValue()); |
base::FilePath small_wallpaper_path = GetCustomWallpaperPath( |
wallpaper::kSmallWallpaperSubDir, kTestUser1Hash, id); |
@@ -244,7 +243,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, |
PreventReloadingSameWallpaper) { |
WallpaperManager* wallpaper_manager = WallpaperManager::Get(); |
// New user log in, a default wallpaper is loaded. |
- LogIn(kTestUser1, kTestUser1Hash); |
+ LogIn(AccountId::FromUserEmail(kTestUser1), kTestUser1Hash); |
EXPECT_EQ(1, LoadedWallpapers()); |
// Loads the same wallpaper before the initial one finished. It should be |
// prevented. |
@@ -295,7 +294,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, |
IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, |
PRE_UseMigratedWallpaperInfo) { |
// New user log in, a default wallpaper is loaded. |
- LogIn(kTestUser1, kTestUser1Hash); |
+ LogIn(AccountId::FromUserEmail(kTestUser1), kTestUser1Hash); |
// Old wallpaper migration code doesn't exist in codebase anymore. Modify user |
// wallpaper info directly to simulate the wallpaper migration. See |
// crosbug.com/38429 for details about why we modify wallpaper info this way. |
@@ -314,7 +313,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, |
IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, |
UseMigratedWallpaperInfo) { |
- LogIn(kTestUser1, kTestUser1Hash); |
+ LogIn(AccountId::FromUserEmail(kTestUser1), kTestUser1Hash); |
wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); |
// This test should finish normally. If timeout, it is probably because |
// migrated wallpaper is somehow not loaded. Bad things can happen if |
@@ -326,7 +325,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, |
IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, |
PRE_UsePreMigrationWallpaperInfo) { |
// New user log in, a default wallpaper is loaded. |
- LogIn(kTestUser1, kTestUser1Hash); |
+ LogIn(AccountId::FromUserEmail(kTestUser1), kTestUser1Hash); |
// Old wallpaper migration code doesn't exist in codebase anymore. So if |
// user's profile is not migrated, it is the same as no wallpaper info. To |
// simulate this, we remove user's wallpaper info here. |
@@ -335,7 +334,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, |
IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, |
UsePreMigrationWallpaperInfo) { |
- LogIn(kTestUser1, kTestUser1Hash); |
+ LogIn(AccountId::FromUserEmail(kTestUser1), kTestUser1Hash); |
wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); |
// This test should finish normally. If timeout, it is probably because chrome |
// can not handle pre migrated user profile (M21 profile or older). |
@@ -372,7 +371,7 @@ class WallpaperManagerBrowserTestNoAnimation |
IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestNoAnimation, |
PRE_UseMigratedWallpaperInfo) { |
// New user log in, a default wallpaper is loaded. |
- LogIn(kTestUser1, kTestUser1Hash); |
+ LogIn(AccountId::FromUserEmail(kTestUser1), kTestUser1Hash); |
// Old wallpaper migration code doesn't exist in codebase anymore. Modify user |
// wallpaper info directly to simulate the wallpaper migration. See |
// crosbug.com/38429 for details about why we modify wallpaper info this way. |
@@ -391,7 +390,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestNoAnimation, |
IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestNoAnimation, |
UseMigratedWallpaperInfo) { |
- LogIn(kTestUser1, kTestUser1Hash); |
+ LogIn(AccountId::FromUserEmail(kTestUser1), kTestUser1Hash); |
wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); |
// This test should finish normally. If timeout, it is probably because |
// migrated wallpaper is somehow not loaded. Bad things can happen if |
@@ -403,7 +402,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestNoAnimation, |
IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestNoAnimation, |
PRE_UsePreMigrationWallpaperInfo) { |
// New user log in, a default wallpaper is loaded. |
- LogIn(kTestUser1, kTestUser1Hash); |
+ LogIn(AccountId::FromUserEmail(kTestUser1), kTestUser1Hash); |
wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); |
// Old wallpaper migration code doesn't exist in codebase anymore. So if |
// user's profile is not migrated, it is the same as no wallpaper info. To |
@@ -413,7 +412,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestNoAnimation, |
IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestNoAnimation, |
UsePreMigrationWallpaperInfo) { |
- LogIn(kTestUser1, kTestUser1Hash); |
+ LogIn(AccountId::FromUserEmail(kTestUser1), kTestUser1Hash); |
wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); |
// This test should finish normally. If timeout, it is probably because chrome |
// can not handle pre migrated user profile (M21 profile or older). |
@@ -432,7 +431,7 @@ class WallpaperManagerBrowserTestCrashRestore |
IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestCrashRestore, |
PRE_RestoreWallpaper) { |
- LogIn(kTestUser1, kTestUser1Hash); |
+ LogIn(AccountId::FromUserEmail(kTestUser1), kTestUser1Hash); |
wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); |
} |
@@ -467,7 +466,7 @@ class WallpaperManagerBrowserTestCacheUpdate |
IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestCacheUpdate, |
PRE_VerifyWallpaperCache) { |
// Add kTestUser1 to user list. kTestUser1 is the default login profile. |
- LogIn(kTestUser1, kTestUser1Hash); |
+ LogIn(AccountId::FromUserEmail(kTestUser1), kTestUser1Hash); |
std::string id = base::Int64ToString(base::Time::Now().ToInternalValue()); |
WallpaperManager* wallpaper_manager = WallpaperManager::Get(); |
@@ -533,7 +532,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestCacheUpdate, |
EXPECT_TRUE(test_api->GetPathFromCache(kTestUser1, &original_path)); |
EXPECT_FALSE(original_path.empty()); |
- LogIn(kTestUser2, kTestUser2Hash); |
+ LogIn(AccountId::FromUserEmail(kTestUser2), kTestUser2Hash); |
wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); |
// Login another user should not delete logged in user's wallpaper cache. |
// Note active user is still kTestUser1. |
@@ -754,7 +753,8 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, SmallGuestWallpaper) { |
return; |
CreateCmdlineWallpapers(); |
user_manager::UserManager::Get()->UserLoggedIn( |
- chromeos::login::kGuestUserName, chromeos::login::kGuestUserName, false); |
+ chromeos::login::GuestAccountId(), chromeos::login::kGuestUserName, |
+ false); |
UpdateDisplay("800x600"); |
WallpaperManager::Get()->SetDefaultWallpaperNow(std::string()); |
wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); |
@@ -769,7 +769,8 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, LargeGuestWallpaper) { |
CreateCmdlineWallpapers(); |
user_manager::UserManager::Get()->UserLoggedIn( |
- chromeos::login::kGuestUserName, chromeos::login::kGuestUserName, false); |
+ chromeos::login::GuestAccountId(), chromeos::login::kGuestUserName, |
+ false); |
UpdateDisplay("1600x1200"); |
WallpaperManager::Get()->SetDefaultWallpaperNow(std::string()); |
wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); |
@@ -782,7 +783,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, SmallChildWallpaper) { |
if (!ash::test::AshTestHelper::SupportsMultipleDisplays()) |
return; |
CreateCmdlineWallpapers(); |
- LogInAsChild(kTestUser1, kTestUser1Hash); |
+ LogInAsChild(AccountId::FromUserEmail(kTestUser1), kTestUser1Hash); |
UpdateDisplay("800x600"); |
WallpaperManager::Get()->SetDefaultWallpaperNow(std::string()); |
wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); |
@@ -796,7 +797,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, LargeChildWallpaper) { |
return; |
CreateCmdlineWallpapers(); |
- LogInAsChild(kTestUser1, kTestUser1Hash); |
+ LogInAsChild(AccountId::FromUserEmail(kTestUser1), kTestUser1Hash); |
UpdateDisplay("1600x1200"); |
WallpaperManager::Get()->SetDefaultWallpaperNow(std::string()); |
wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); |
@@ -811,7 +812,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, |
UpdateDisplay("640x480"); |
CreateCmdlineWallpapers(); |
user_manager::UserManager::Get()->UserLoggedIn( |
- chromeos::login::kStubUser, "test_hash", false); |
+ chromeos::login::StubAccountId(), "test_hash", false); |
WallpaperManager::Get()->SetDefaultWallpaperNow(std::string()); |