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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 virtual void CleanUpOnMainThread() OVERRIDE { | 51 virtual void CleanUpOnMainThread() OVERRIDE { |
52 CrosSettings* settings = CrosSettings::Get(); | 52 CrosSettings* settings = CrosSettings::Get(); |
53 settings->RemoveSettingsProvider(&stub_settings_provider_); | 53 settings->RemoveSettingsProvider(&stub_settings_provider_); |
54 settings->AddSettingsProvider(device_settings_provider_); | 54 settings->AddSettingsProvider(device_settings_provider_); |
55 LoginManagerTest::CleanUpOnMainThread(); | 55 LoginManagerTest::CleanUpOnMainThread(); |
56 } | 56 } |
57 | 57 |
58 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 58 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
59 LoginManagerTest::SetUpCommandLine(command_line); | 59 LoginManagerTest::SetUpCommandLine(command_line); |
60 command_line->AppendSwitch(::switches::kMultiProfiles); | |
61 } | 60 } |
62 | 61 |
63 protected: | 62 protected: |
64 void CheckAccountsUI(const User* user, bool is_owner) { | 63 void CheckAccountsUI(const User* user, bool is_owner) { |
65 Profile* profile = UserManager::Get()->GetProfileByUser(user); | 64 Profile* profile = UserManager::Get()->GetProfileByUser(user); |
66 profile->GetPrefs()->SetString(prefs::kGoogleServicesUsername, | 65 profile->GetPrefs()->SetString(prefs::kGoogleServicesUsername, |
67 user->email()); | 66 user->email()); |
68 | 67 |
69 ui_test_utils::BrowserAddedObserver observer; | 68 ui_test_utils::BrowserAddedObserver observer; |
70 Browser* browser = CreateBrowser(profile); | 69 Browser* browser = CreateBrowser(profile); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 AddUser(kTestUsers[1]); | 128 AddUser(kTestUsers[1]); |
130 | 129 |
131 UserManager* manager = UserManager::Get(); | 130 UserManager* manager = UserManager::Get(); |
132 ASSERT_EQ(2u, manager->GetLoggedInUsers().size()); | 131 ASSERT_EQ(2u, manager->GetLoggedInUsers().size()); |
133 | 132 |
134 CheckAccountsUI(manager->FindUser(kTestUsers[0]), true /* is_owner */); | 133 CheckAccountsUI(manager->FindUser(kTestUsers[0]), true /* is_owner */); |
135 CheckAccountsUI(manager->FindUser(kTestUsers[1]), false /* is_owner */); | 134 CheckAccountsUI(manager->FindUser(kTestUsers[1]), false /* is_owner */); |
136 } | 135 } |
137 | 136 |
138 } // namespace chromeos | 137 } // namespace chromeos |
OLD | NEW |