| 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" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 protected: | 112 protected: |
| 113 void CheckOptionsUI(const user_manager::User* user, | 113 void CheckOptionsUI(const user_manager::User* user, |
| 114 bool is_owner, | 114 bool is_owner, |
| 115 bool is_primary) { | 115 bool is_primary) { |
| 116 Browser* browser = CreateBrowserForUser(user); | 116 Browser* browser = CreateBrowserForUser(user); |
| 117 content::WebContents* contents = | 117 content::WebContents* contents = |
| 118 browser->tab_strip_model()->GetActiveWebContents(); | 118 browser->tab_strip_model()->GetActiveWebContents(); |
| 119 | 119 |
| 120 for (size_t i = 0; i < sizeof(kPrefTests) / sizeof(kPrefTests[0]); i++) { | 120 for (size_t i = 0; i < sizeof(kPrefTests) / sizeof(kPrefTests[0]); i++) { |
| 121 CheckPreference(contents, | 121 bool disabled = !is_owner && kPrefTests[i].owner_only; |
| 122 kPrefTests[i].pref_name, | 122 if (strcmp(kPrefTests[i].pref_name, kSystemTimezone) == 0) { |
| 123 !is_owner && kPrefTests[i].owner_only, | 123 disabled = ProfileHelper::Get() |
| 124 !is_owner && kPrefTests[i].indicator ? "owner" : | 124 ->GetProfileByUserUnsafe(user) |
| 125 std::string()); | 125 ->GetPrefs() |
| 126 ->GetBoolean(prefs::kResolveTimezoneByGeolocation); |
| 127 } |
| 128 |
| 129 CheckPreference( |
| 130 contents, kPrefTests[i].pref_name, disabled, |
| 131 !is_owner && kPrefTests[i].indicator ? "owner" : std::string()); |
| 126 } | 132 } |
| 127 CheckBanner(contents, is_primary); | 133 CheckBanner(contents, is_primary); |
| 128 CheckSharedSections(contents, is_primary); | 134 CheckSharedSections(contents, is_primary); |
| 129 CheckAccountsOverlay(contents, is_owner); | 135 CheckAccountsOverlay(contents, is_owner); |
| 130 } | 136 } |
| 131 | 137 |
| 132 // Creates a browser and navigates to the Settings page. | 138 // Creates a browser and navigates to the Settings page. |
| 133 Browser* CreateBrowserForUser(const user_manager::User* user) { | 139 Browser* CreateBrowserForUser(const user_manager::User* user) { |
| 134 Profile* profile = ProfileHelper::Get()->GetProfileByUserUnsafe(user); | 140 Profile* profile = ProfileHelper::Get()->GetProfileByUserUnsafe(user); |
| 135 SigninManagerFactory::GetForProfile(profile)-> | 141 SigninManagerFactory::GetForProfile(profile)-> |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 content::WaitForLoadStop(contents); | 428 content::WaitForLoadStop(contents); |
| 423 { | 429 { |
| 424 SCOPED_TRACE("Screen lock false for both users"); | 430 SCOPED_TRACE("Screen lock false for both users"); |
| 425 expected_value = false; | 431 expected_value = false; |
| 426 CheckBooleanPreference(contents, prefs::kEnableAutoScreenLock, disabled, | 432 CheckBooleanPreference(contents, prefs::kEnableAutoScreenLock, disabled, |
| 427 empty_controlled, expected_value); | 433 empty_controlled, expected_value); |
| 428 } | 434 } |
| 429 } | 435 } |
| 430 | 436 |
| 431 } // namespace chromeos | 437 } // namespace chromeos |
| OLD | NEW |