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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 CrosSettings* settings = CrosSettings::Get(); | 96 CrosSettings* settings = CrosSettings::Get(); |
97 | 97 |
98 // Add the stub settings provider, moving the device settings provider | 98 // Add the stub settings provider, moving the device settings provider |
99 // behind it so our stub takes precedence. | 99 // behind it so our stub takes precedence. |
100 device_settings_provider_ = settings->GetProvider(kDeviceOwner); | 100 device_settings_provider_ = settings->GetProvider(kDeviceOwner); |
101 settings->RemoveSettingsProvider(device_settings_provider_); | 101 settings->RemoveSettingsProvider(device_settings_provider_); |
102 settings->AddSettingsProvider(&stub_settings_provider_); | 102 settings->AddSettingsProvider(&stub_settings_provider_); |
103 settings->AddSettingsProvider(device_settings_provider_); | 103 settings->AddSettingsProvider(device_settings_provider_); |
104 } | 104 } |
105 | 105 |
106 virtual void CleanUpOnMainThread() OVERRIDE { | 106 virtual void TearDownOnMainThread() OVERRIDE { |
107 CrosSettings* settings = CrosSettings::Get(); | 107 CrosSettings* settings = CrosSettings::Get(); |
108 settings->RemoveSettingsProvider(&stub_settings_provider_); | 108 settings->RemoveSettingsProvider(&stub_settings_provider_); |
109 LoginManagerTest::CleanUpOnMainThread(); | 109 LoginManagerTest::TearDownOnMainThread(); |
110 } | 110 } |
111 | 111 |
112 protected: | 112 protected: |
113 void CheckOptionsUI(const User* user, bool is_owner, bool is_primary) { | 113 void CheckOptionsUI(const User* user, bool is_owner, bool is_primary) { |
114 Browser* browser = CreateBrowserForUser(user); | 114 Browser* browser = CreateBrowserForUser(user); |
115 content::WebContents* contents = | 115 content::WebContents* contents = |
116 browser->tab_strip_model()->GetActiveWebContents(); | 116 browser->tab_strip_model()->GetActiveWebContents(); |
117 | 117 |
118 for (size_t i = 0; i < sizeof(kPrefTests) / sizeof(kPrefTests[0]); i++) { | 118 for (size_t i = 0; i < sizeof(kPrefTests) / sizeof(kPrefTests[0]); i++) { |
119 CheckPreference(contents, | 119 CheckPreference(contents, |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 content::WaitForLoadStop(contents); | 420 content::WaitForLoadStop(contents); |
421 { | 421 { |
422 SCOPED_TRACE("Screen lock false for both users"); | 422 SCOPED_TRACE("Screen lock false for both users"); |
423 expected_value = false; | 423 expected_value = false; |
424 CheckBooleanPreference(contents, prefs::kEnableAutoScreenLock, disabled, | 424 CheckBooleanPreference(contents, prefs::kEnableAutoScreenLock, disabled, |
425 empty_controlled, expected_value); | 425 empty_controlled, expected_value); |
426 } | 426 } |
427 } | 427 } |
428 | 428 |
429 } // namespace chromeos | 429 } // namespace chromeos |
OLD | NEW |