| 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/ui/user_adding_screen.h" | 10 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 settings->AddSettingsProvider(device_settings_provider_); | 55 settings->AddSettingsProvider(device_settings_provider_); |
| 56 LoginManagerTest::TearDownOnMainThread(); | 56 LoginManagerTest::TearDownOnMainThread(); |
| 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 } | 61 } |
| 62 | 62 |
| 63 protected: | 63 protected: |
| 64 void CheckAccountsUI(const user_manager::User* user, bool is_owner) { | 64 void CheckAccountsUI(const user_manager::User* user, bool is_owner) { |
| 65 Profile* profile = ProfileHelper::Get()->GetProfileByUser(user); | 65 Profile* profile = ProfileHelper::Get()->GetProfileByUserUnsafe(user); |
| 66 profile->GetPrefs()->SetString(prefs::kGoogleServicesUsername, | 66 profile->GetPrefs()->SetString(prefs::kGoogleServicesUsername, |
| 67 user->email()); | 67 user->email()); |
| 68 | 68 |
| 69 ui_test_utils::BrowserAddedObserver observer; | 69 ui_test_utils::BrowserAddedObserver observer; |
| 70 Browser* browser = CreateBrowser(profile); | 70 Browser* browser = CreateBrowser(profile); |
| 71 observer.WaitForSingleNewBrowser(); | 71 observer.WaitForSingleNewBrowser(); |
| 72 | 72 |
| 73 ui_test_utils::NavigateToURL(browser, | 73 ui_test_utils::NavigateToURL(browser, |
| 74 GURL("chrome://settings-frame/accounts")); | 74 GURL("chrome://settings-frame/accounts")); |
| 75 content::WebContents* contents = | 75 content::WebContents* contents = |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 AddUser(kTestUsers[1]); | 137 AddUser(kTestUsers[1]); |
| 138 | 138 |
| 139 UserManager* manager = UserManager::Get(); | 139 UserManager* manager = UserManager::Get(); |
| 140 ASSERT_EQ(2u, manager->GetLoggedInUsers().size()); | 140 ASSERT_EQ(2u, manager->GetLoggedInUsers().size()); |
| 141 | 141 |
| 142 CheckAccountsUI(manager->FindUser(kTestUsers[0]), true /* is_owner */); | 142 CheckAccountsUI(manager->FindUser(kTestUsers[0]), true /* is_owner */); |
| 143 CheckAccountsUI(manager->FindUser(kTestUsers[1]), false /* is_owner */); | 143 CheckAccountsUI(manager->FindUser(kTestUsers[1]), false /* is_owner */); |
| 144 } | 144 } |
| 145 | 145 |
| 146 } // namespace chromeos | 146 } // namespace chromeos |
| OLD | NEW |