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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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()->GetProfileByUserUnsafe(user); | 65 Profile* profile = ProfileHelper::Get()->GetProfileByUserUnsafe(user); |
66 profile->GetPrefs()->SetString(prefs::kGoogleServicesUsername, | |
67 user->email()); | |
68 | 66 |
69 ui_test_utils::BrowserAddedObserver observer; | 67 ui_test_utils::BrowserAddedObserver observer; |
70 Browser* browser = CreateBrowser(profile); | 68 Browser* browser = CreateBrowser(profile); |
71 observer.WaitForSingleNewBrowser(); | 69 observer.WaitForSingleNewBrowser(); |
72 | 70 |
73 ui_test_utils::NavigateToURL(browser, | 71 ui_test_utils::NavigateToURL(browser, |
74 GURL("chrome://settings-frame/accounts")); | 72 GURL("chrome://settings-frame/accounts")); |
75 content::WebContents* contents = | 73 content::WebContents* contents = |
76 browser->tab_strip_model()->GetActiveWebContents(); | 74 browser->tab_strip_model()->GetActiveWebContents(); |
77 | 75 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 AddUser(kTestUsers[1]); | 135 AddUser(kTestUsers[1]); |
138 | 136 |
139 user_manager::UserManager* manager = user_manager::UserManager::Get(); | 137 user_manager::UserManager* manager = user_manager::UserManager::Get(); |
140 ASSERT_EQ(2u, manager->GetLoggedInUsers().size()); | 138 ASSERT_EQ(2u, manager->GetLoggedInUsers().size()); |
141 | 139 |
142 CheckAccountsUI(manager->FindUser(kTestUsers[0]), true /* is_owner */); | 140 CheckAccountsUI(manager->FindUser(kTestUsers[0]), true /* is_owner */); |
143 CheckAccountsUI(manager->FindUser(kTestUsers[1]), false /* is_owner */); | 141 CheckAccountsUI(manager->FindUser(kTestUsers[1]), false /* is_owner */); |
144 } | 142 } |
145 | 143 |
146 } // namespace chromeos | 144 } // namespace chromeos |
OLD | NEW |