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 "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "chrome/browser/chromeos/login/login_manager_test.h" | 9 #include "chrome/browser/chromeos/login/login_manager_test.h" |
10 #include "chrome/browser/chromeos/login/startup_utils.h" | 10 #include "chrome/browser/chromeos/login/startup_utils.h" |
11 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" | 11 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" |
12 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 12 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
13 #include "chrome/browser/chromeos/settings/cros_settings.h" | 13 #include "chrome/browser/chromeos/settings/cros_settings.h" |
14 #include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h" | 14 #include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h" |
| 15 #include "chrome/browser/signin/signin_manager_factory.h" |
15 #include "chrome/browser/ui/browser.h" | 16 #include "chrome/browser/ui/browser.h" |
16 #include "chrome/browser/ui/browser_commands.h" | 17 #include "chrome/browser/ui/browser_commands.h" |
17 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 18 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
18 #include "chrome/common/pref_names.h" | 19 #include "chrome/common/pref_names.h" |
19 #include "chrome/test/base/ui_test_utils.h" | 20 #include "chrome/test/base/ui_test_utils.h" |
20 #include "chromeos/settings/cros_settings_names.h" | 21 #include "chromeos/settings/cros_settings_names.h" |
| 22 #include "components/signin/core/browser/signin_manager.h" |
21 #include "components/user_manager/user_manager.h" | 23 #include "components/user_manager/user_manager.h" |
22 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.h" |
23 #include "content/public/test/browser_test_utils.h" | 25 #include "content/public/test/browser_test_utils.h" |
24 #include "content/public/test/test_utils.h" | 26 #include "content/public/test/test_utils.h" |
25 | 27 |
26 namespace chromeos { | 28 namespace chromeos { |
27 | 29 |
28 namespace { | 30 namespace { |
29 | 31 |
30 const char* kTestOwner = "test-owner@example.com"; | 32 const char* kTestOwner = "test-owner@example.com"; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 std::string()); | 127 std::string()); |
126 } | 128 } |
127 CheckBanner(contents, is_primary); | 129 CheckBanner(contents, is_primary); |
128 CheckSharedSections(contents, is_primary); | 130 CheckSharedSections(contents, is_primary); |
129 CheckAccountsOverlay(contents, is_owner); | 131 CheckAccountsOverlay(contents, is_owner); |
130 } | 132 } |
131 | 133 |
132 // Creates a browser and navigates to the Settings page. | 134 // Creates a browser and navigates to the Settings page. |
133 Browser* CreateBrowserForUser(const user_manager::User* user) { | 135 Browser* CreateBrowserForUser(const user_manager::User* user) { |
134 Profile* profile = ProfileHelper::Get()->GetProfileByUserUnsafe(user); | 136 Profile* profile = ProfileHelper::Get()->GetProfileByUserUnsafe(user); |
135 profile->GetPrefs()->SetString(prefs::kGoogleServicesUsername, | 137 SigninManagerFactory::GetForProfile(profile)-> |
136 user->email()); | 138 SetAuthenticatedUsername(user->email()); |
137 | 139 |
138 ui_test_utils::BrowserAddedObserver observer; | 140 ui_test_utils::BrowserAddedObserver observer; |
139 Browser* browser = CreateBrowser(profile); | 141 Browser* browser = CreateBrowser(profile); |
140 observer.WaitForSingleNewBrowser(); | 142 observer.WaitForSingleNewBrowser(); |
141 | 143 |
142 ui_test_utils::NavigateToURL(browser, | 144 ui_test_utils::NavigateToURL(browser, |
143 GURL("chrome://settings-frame")); | 145 GURL("chrome://settings-frame")); |
144 return browser; | 146 return browser; |
145 } | 147 } |
146 | 148 |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 content::WaitForLoadStop(contents); | 424 content::WaitForLoadStop(contents); |
423 { | 425 { |
424 SCOPED_TRACE("Screen lock false for both users"); | 426 SCOPED_TRACE("Screen lock false for both users"); |
425 expected_value = false; | 427 expected_value = false; |
426 CheckBooleanPreference(contents, prefs::kEnableAutoScreenLock, disabled, | 428 CheckBooleanPreference(contents, prefs::kEnableAutoScreenLock, disabled, |
427 empty_controlled, expected_value); | 429 empty_controlled, expected_value); |
428 } | 430 } |
429 } | 431 } |
430 | 432 |
431 } // namespace chromeos | 433 } // namespace chromeos |
OLD | NEW |