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

Unified Diff: chrome/browser/ui/webui/options/chromeos/shared_options_browsertest.cc

Issue 1425093004: Revert of 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: 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/ui/webui/options/chromeos/shared_options_browsertest.cc
diff --git a/chrome/browser/ui/webui/options/chromeos/shared_options_browsertest.cc b/chrome/browser/ui/webui/options/chromeos/shared_options_browsertest.cc
index 1055a8ddc1cac7241bb17c7eb10d5dea02372e00..9ec75fe5ead89ea4589271d7fc83de69c9d0da16 100644
--- a/chrome/browser/ui/webui/options/chromeos/shared_options_browsertest.cc
+++ b/chrome/browser/ui/webui/options/chromeos/shared_options_browsertest.cc
@@ -86,10 +86,8 @@
class SharedOptionsTest : public LoginManagerTest {
public:
SharedOptionsTest()
- : LoginManagerTest(false),
- device_settings_provider_(NULL),
- test_owner_account_id_(AccountId::FromUserEmail(kTestOwner)),
- test_non_owner_account_id_(AccountId::FromUserEmail(kTestNonOwner)) {
+ : LoginManagerTest(false),
+ device_settings_provider_(NULL) {
stub_settings_provider_.Set(kDeviceOwner, base::StringValue(kTestOwner));
}
@@ -268,43 +266,40 @@
StubAccountSettingsProvider stub_settings_provider_;
CrosSettingsProvider* device_settings_provider_;
- const AccountId test_owner_account_id_;
- const AccountId test_non_owner_account_id_;
-
private:
DISALLOW_COPY_AND_ASSIGN(SharedOptionsTest);
};
IN_PROC_BROWSER_TEST_F(SharedOptionsTest, PRE_SharedOptions) {
- RegisterUser(test_owner_account_id_.GetUserEmail());
- RegisterUser(test_non_owner_account_id_.GetUserEmail());
+ RegisterUser(kTestOwner);
+ RegisterUser(kTestNonOwner);
StartupUtils::MarkOobeCompleted();
}
IN_PROC_BROWSER_TEST_F(SharedOptionsTest, SharedOptions) {
// Log in the owner first, then add a secondary user.
- LoginUser(test_owner_account_id_.GetUserEmail());
+ LoginUser(kTestOwner);
UserAddingScreen::Get()->Start();
content::RunAllPendingInMessageLoop();
- AddUser(test_non_owner_account_id_.GetUserEmail());
+ AddUser(kTestNonOwner);
user_manager::UserManager* manager = user_manager::UserManager::Get();
ASSERT_EQ(2u, manager->GetLoggedInUsers().size());
{
SCOPED_TRACE("Checking settings for owner, primary user.");
- CheckOptionsUI(manager->FindUser(manager->GetOwnerAccountId()), true, true);
+ CheckOptionsUI(manager->FindUser(manager->GetOwnerEmail()), true, true);
}
{
SCOPED_TRACE("Checking settings for non-owner, secondary user.");
- CheckOptionsUI(manager->FindUser(test_non_owner_account_id_), false, false);
+ CheckOptionsUI(manager->FindUser(kTestNonOwner), false, false);
}
// TODO(michaelpg): Add tests for non-primary owner and primary non-owner
// when the owner-only multiprofile restriction is removed, probably M38.
}
IN_PROC_BROWSER_TEST_F(SharedOptionsTest, PRE_ScreenLockPreferencePrimary) {
- RegisterUser(test_owner_account_id_.GetUserEmail());
- RegisterUser(test_non_owner_account_id_.GetUserEmail());
+ RegisterUser(kTestOwner);
+ RegisterUser(kTestNonOwner);
StartupUtils::MarkOobeCompleted();
}
@@ -314,15 +309,14 @@
// other signed-in user has enabled this preference, the shared setting
// indicator explains this.)
IN_PROC_BROWSER_TEST_F(SharedOptionsTest, ScreenLockPreferencePrimary) {
- LoginUser(test_owner_account_id_.GetUserEmail());
+ LoginUser(kTestOwner);
UserAddingScreen::Get()->Start();
content::RunAllPendingInMessageLoop();
- AddUser(test_non_owner_account_id_.GetUserEmail());
+ AddUser(kTestNonOwner);
user_manager::UserManager* manager = user_manager::UserManager::Get();
- const user_manager::User* user1 = manager->FindUser(test_owner_account_id_);
- const user_manager::User* user2 =
- manager->FindUser(test_non_owner_account_id_);
+ const user_manager::User* user1 = manager->FindUser(kTestOwner);
+ const user_manager::User* user2 = manager->FindUser(kTestNonOwner);
PrefService* prefs1 =
ProfileHelper::Get()->GetProfileByUserUnsafe(user1)->GetPrefs();
@@ -375,8 +369,8 @@
}
IN_PROC_BROWSER_TEST_F(SharedOptionsTest, PRE_ScreenLockPreferenceSecondary) {
- RegisterUser(test_owner_account_id_.GetUserEmail());
- RegisterUser(test_non_owner_account_id_.GetUserEmail());
+ RegisterUser(kTestOwner);
+ RegisterUser(kTestNonOwner);
StartupUtils::MarkOobeCompleted();
}
@@ -386,15 +380,14 @@
// other signed-in user has enabled this preference, the shared setting
// indicator explains this.)
IN_PROC_BROWSER_TEST_F(SharedOptionsTest, ScreenLockPreferenceSecondary) {
- LoginUser(test_owner_account_id_.GetUserEmail());
+ LoginUser(kTestOwner);
UserAddingScreen::Get()->Start();
content::RunAllPendingInMessageLoop();
- AddUser(test_non_owner_account_id_.GetUserEmail());
+ AddUser(kTestNonOwner);
user_manager::UserManager* manager = user_manager::UserManager::Get();
- const user_manager::User* user1 = manager->FindUser(test_owner_account_id_);
- const user_manager::User* user2 =
- manager->FindUser(test_non_owner_account_id_);
+ const user_manager::User* user1 = manager->FindUser(kTestOwner);
+ const user_manager::User* user2 = manager->FindUser(kTestNonOwner);
PrefService* prefs1 =
ProfileHelper::Get()->GetProfileByUserUnsafe(user1)->GetPrefs();

Powered by Google App Engine
This is Rietveld 408576698