| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "chrome/browser/chromeos/login/login_manager_test.h" | 8 #include "chrome/browser/chromeos/login/login_manager_test.h" |
| 9 #include "chrome/browser/chromeos/login/startup_utils.h" | 9 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 10 #include "chrome/browser/chromeos/login/user_adding_screen.h" | 10 #include "chrome/browser/chromeos/login/user_adding_screen.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 virtual void CleanUpOnMainThread() OVERRIDE { | 52 virtual void CleanUpOnMainThread() OVERRIDE { |
| 53 CrosSettings* settings = CrosSettings::Get(); | 53 CrosSettings* settings = CrosSettings::Get(); |
| 54 settings->RemoveSettingsProvider(&stub_settings_provider_); | 54 settings->RemoveSettingsProvider(&stub_settings_provider_); |
| 55 settings->AddSettingsProvider(device_settings_provider_); | 55 settings->AddSettingsProvider(device_settings_provider_); |
| 56 LoginManagerTest::CleanUpOnMainThread(); | 56 LoginManagerTest::CleanUpOnMainThread(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 59 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 60 LoginManagerTest::SetUpCommandLine(command_line); | 60 LoginManagerTest::SetUpCommandLine(command_line); |
| 61 command_line->AppendSwitch(::switches::kMultiProfiles); | 61 command_line->AppendSwitch(::switches::kMultiProfiles); |
| 62 command_line->AppendSwitch(switches::kForceMultiProfileInTests); |
| 62 } | 63 } |
| 63 | 64 |
| 64 protected: | 65 protected: |
| 65 void CheckAccountsUI(const User* user, bool is_owner) { | 66 void CheckAccountsUI(const User* user, bool is_owner) { |
| 66 Profile* profile = UserManager::Get()->GetProfileByUser(user); | 67 Profile* profile = UserManager::Get()->GetProfileByUser(user); |
| 67 profile->GetPrefs()->SetString(prefs::kGoogleServicesUsername, | 68 profile->GetPrefs()->SetString(prefs::kGoogleServicesUsername, |
| 68 user->email()); | 69 user->email()); |
| 69 | 70 |
| 70 ui_test_utils::BrowserAddedObserver observer; | 71 ui_test_utils::BrowserAddedObserver observer; |
| 71 Browser* browser = CreateBrowser(profile); | 72 Browser* browser = CreateBrowser(profile); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 AddUser(kTestUsers[1]); | 131 AddUser(kTestUsers[1]); |
| 131 | 132 |
| 132 UserManager* manager = UserManager::Get(); | 133 UserManager* manager = UserManager::Get(); |
| 133 ASSERT_EQ(2u, manager->GetLoggedInUsers().size()); | 134 ASSERT_EQ(2u, manager->GetLoggedInUsers().size()); |
| 134 | 135 |
| 135 CheckAccountsUI(manager->FindUser(kTestUsers[0]), true /* is_owner */); | 136 CheckAccountsUI(manager->FindUser(kTestUsers[0]), true /* is_owner */); |
| 136 CheckAccountsUI(manager->FindUser(kTestUsers[1]), false /* is_owner */); | 137 CheckAccountsUI(manager->FindUser(kTestUsers[1]), false /* is_owner */); |
| 137 } | 138 } |
| 138 | 139 |
| 139 } // namespace chromeos | 140 } // namespace chromeos |
| OLD | NEW |