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

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

Issue 1412813003: This CL replaces user_manager::UserID with AccountId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@468875--Chrome-OS-handles-deletion-of-Gmail-account-poorly--Create-AccountID-structure-part2--user_names
Patch Set: Update after review. Created 5 years, 2 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/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..b8a7e8de9cde7d403bfe3aac86916b84de8bde1c 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,20 @@ 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 |account_id|.
+ void LogIn(const AccountId& account_id, const std::string& user_id_hash) {
+ user_manager::UserManager::Get()->UserLoggedIn(account_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 |account_id| and sets it as child account.
+ void LogInAsChild(const AccountId& account_id,
+ const std::string& user_id_hash) {
+ user_manager::UserManager::Get()->UserLoggedIn(account_id, user_id_hash,
+ false);
user_manager::User* user =
- user_manager::UserManager::Get()->FindUserAndModify(username);
+ user_manager::UserManager::Get()->FindUserAndModify(account_id);
user_manager::UserManager::Get()->ChangeUserChildStatus(
user, true /* is_child */);
}
@@ -168,7 +168,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 +244,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 +295,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 +314,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 +326,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 +335,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 +372,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 +391,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 +403,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 +413,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 +432,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 +467,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 +533,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 +754,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 +770,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 +784,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 +798,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 +813,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());

Powered by Google App Engine
This is Rietveld 408576698