Index: chrome/browser/chromeos/accessibility/magnification_manager_browsertest.cc |
diff --git a/chrome/browser/chromeos/accessibility/magnification_manager_browsertest.cc b/chrome/browser/chromeos/accessibility/magnification_manager_browsertest.cc |
index 2cec6c3632322feb3e7a21c267101de1032d77ee..970973c9aab6333ccdfc4c4cfc79a0cd036fcfa2 100644 |
--- a/chrome/browser/chromeos/accessibility/magnification_manager_browsertest.cc |
+++ b/chrome/browser/chromeos/accessibility/magnification_manager_browsertest.cc |
@@ -91,12 +91,11 @@ |
return prefs()->GetBoolean(prefs::kAccessibilityScreenMagnifierEnabled); |
} |
-// Creates and logs into a profile with account |account_id|, and makes sure |
-// that the profile is regarded as "non new" in the next login. This is used in |
+// Creates and logs into a profile with account |name|, and makes sure that |
+// the profile is regarded as "non new" in the next login. This is used in |
// PRE_XXX cases so that in the main XXX case we can test non new profiles. |
-void PrepareNonNewProfile(const AccountId& account_id) { |
- user_manager::UserManager::Get()->UserLoggedIn( |
- account_id, account_id.GetUserEmail(), true); |
+void PrepareNonNewProfile(const std::string& name) { |
+ user_manager::UserManager::Get()->UserLoggedIn(name, name, true); |
// To prepare a non-new profile for tests, we must ensure the profile |
// directory and the preference files are created, because that's what |
// Profile::IsNewProfile() checks. UserLoggedIn(), however, does not yet |
@@ -164,14 +163,12 @@ |
ProfileManager::GetActiveUserProfile()); |
} |
- const AccountId test_account_id_ = AccountId::FromUserEmail(kTestUserName); |
- |
DISALLOW_COPY_AND_ASSIGN(MagnificationManagerTest); |
}; |
IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, PRE_LoginOffToOff) { |
// Create a new profile once, to run the test with non-new profile. |
- PrepareNonNewProfile(test_account_id_); |
+ PrepareNonNewProfile(kTestUserName); |
// Sets pref to explicitly disable the magnifier. |
SetScreenMagnifierEnabledPref(false); |
@@ -186,8 +183,8 @@ |
EXPECT_FALSE(IsMagnifierEnabled()); |
// Logs in with existing profile. |
- user_manager::UserManager::Get()->UserLoggedIn(test_account_id_, |
- kTestUserName, true); |
+ user_manager::UserManager::Get()->UserLoggedIn( |
+ kTestUserName, kTestUserName, true); |
// Confirms that magnifier is still disabled just after login. |
EXPECT_FALSE(IsMagnifierEnabled()); |
@@ -207,7 +204,7 @@ |
IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, PRE_LoginFullToOff) { |
// Create a new profile once, to run the test with non-new profile. |
- PrepareNonNewProfile(test_account_id_); |
+ PrepareNonNewProfile(kTestUserName); |
// Sets pref to explicitly disable the magnifier. |
SetScreenMagnifierEnabledPref(false); |
@@ -226,8 +223,8 @@ |
EXPECT_EQ(2.5, GetFullScreenMagnifierScale()); |
// Logs in (but the session is not started yet). |
- user_manager::UserManager::Get()->UserLoggedIn(test_account_id_, |
- kTestUserName, true); |
+ user_manager::UserManager::Get()->UserLoggedIn( |
+ kTestUserName, kTestUserName, true); |
// Confirms that magnifier is keeping enabled. |
EXPECT_TRUE(IsMagnifierEnabled()); |
@@ -242,7 +239,7 @@ |
IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, PRE_LoginOffToFull) { |
// Create a new profile once, to run the test with non-new profile. |
- PrepareNonNewProfile(test_account_id_); |
+ PrepareNonNewProfile(kTestUserName); |
// Sets prefs to explicitly enable the magnifier. |
SetScreenMagnifierEnabledPref(true); |
@@ -256,8 +253,8 @@ |
EXPECT_FALSE(IsMagnifierEnabled()); |
// Logs in (but the session is not started yet). |
- user_manager::UserManager::Get()->UserLoggedIn(test_account_id_, |
- kTestUserName, true); |
+ user_manager::UserManager::Get()->UserLoggedIn( |
+ kTestUserName, kTestUserName, true); |
// Confirms that magnifier is keeping disabled. |
EXPECT_FALSE(IsMagnifierEnabled()); |
@@ -274,7 +271,7 @@ |
IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, PRE_LoginFullToFull) { |
// Create a new profile once, to run the test with non-new profile. |
- PrepareNonNewProfile(test_account_id_); |
+ PrepareNonNewProfile(kTestUserName); |
// Sets prefs to explicitly enable the magnifier. |
SetScreenMagnifierEnabledPref(true); |
@@ -292,8 +289,8 @@ |
EXPECT_EQ(3.0, GetFullScreenMagnifierScale()); |
// Logs in (but the session is not started yet). |
- user_manager::UserManager::Get()->UserLoggedIn(test_account_id_, |
- kTestUserName, true); |
+ user_manager::UserManager::Get()->UserLoggedIn( |
+ kTestUserName, kTestUserName, true); |
// Confirms that magnifier is keeping enabled. |
EXPECT_TRUE(IsMagnifierEnabled()); |
@@ -311,7 +308,7 @@ |
IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, PRE_LoginFullToUnset) { |
// Creates a new profile once, to run the test with non-new profile. |
- PrepareNonNewProfile(test_account_id_); |
+ PrepareNonNewProfile(kTestUserName); |
} |
IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginFullToUnset) { |
@@ -322,8 +319,8 @@ |
EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); |
// Logs in (but the session is not started yet). |
- user_manager::UserManager::Get()->UserLoggedIn(test_account_id_, |
- kTestUserName, true); |
+ user_manager::UserManager::Get()->UserLoggedIn( |
+ kTestUserName, kTestUserName, true); |
// Confirms that magnifier is keeping enabled. |
EXPECT_TRUE(IsMagnifierEnabled()); |
@@ -344,8 +341,8 @@ |
SetMagnifierEnabled(false); |
// Logs in (but the session is not started yet). |
- user_manager::UserManager::Get()->UserLoggedIn(test_account_id_, |
- kTestUserName, true); |
+ user_manager::UserManager::Get()->UserLoggedIn( |
+ kTestUserName, kTestUserName, true); |
// Confirms that magnifier is keeping disabled. |
EXPECT_FALSE(IsMagnifierEnabled()); |
@@ -367,8 +364,8 @@ |
EXPECT_EQ(2.5, GetFullScreenMagnifierScale()); |
// Logs in (but the session is not started yet). |
- user_manager::UserManager::Get()->UserLoggedIn(test_account_id_, |
- kTestUserName, true); |
+ user_manager::UserManager::Get()->UserLoggedIn( |
+ kTestUserName, kTestUserName, true); |
// Confirms that magnifier is keeping enabled. |
EXPECT_TRUE(IsMagnifierEnabled()); |
@@ -388,8 +385,8 @@ |
EXPECT_FALSE(IsMagnifierEnabled()); |
// Logs in (but the session is not started yet). |
- user_manager::UserManager::Get()->UserLoggedIn(test_account_id_, |
- kTestUserName, true); |
+ user_manager::UserManager::Get()->UserLoggedIn( |
+ kTestUserName, kTestUserName, true); |
// Confirms that magnifier is keeping disabled. |
EXPECT_FALSE(IsMagnifierEnabled()); |
@@ -460,8 +457,8 @@ |
IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, TypePref) { |
// Logs in |
- user_manager::UserManager::Get()->UserLoggedIn(test_account_id_, |
- kTestUserName, true); |
+ user_manager::UserManager::Get()->UserLoggedIn( |
+ kTestUserName, kTestUserName, true); |
user_manager::UserManager::Get()->SessionStarted(); |
// Confirms that magnifier is disabled just after login. |