| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/webui/options/preferences_browsertest.h" | 5 #include "chrome/browser/ui/webui/options/preferences_browsertest.h" |
| 6 | 6 |
| 7 #include <iostream> | 7 #include <iostream> |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 | 9 |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 | 166 |
| 167 // Forwards notifications received when pref values change in the backend. | 167 // Forwards notifications received when pref values change in the backend. |
| 168 void PreferencesBrowserTest::OnPreferenceChanged(const std::string& pref_name) { | 168 void PreferencesBrowserTest::OnPreferenceChanged(const std::string& pref_name) { |
| 169 OnCommit(pref_service_->FindPreference(pref_name.c_str())); | 169 OnCommit(pref_service_->FindPreference(pref_name.c_str())); |
| 170 } | 170 } |
| 171 | 171 |
| 172 // Sets up a mock user policy provider. | 172 // Sets up a mock user policy provider. |
| 173 void PreferencesBrowserTest::SetUpInProcessBrowserTestFixture() { | 173 void PreferencesBrowserTest::SetUpInProcessBrowserTestFixture() { |
| 174 EXPECT_CALL(policy_provider_, IsInitializationComplete(_)) | 174 EXPECT_CALL(policy_provider_, IsInitializationComplete(_)) |
| 175 .WillRepeatedly(Return(true)); | 175 .WillRepeatedly(Return(true)); |
| 176 EXPECT_CALL(policy_provider_, RegisterPolicyDomain(_, _)) | 176 EXPECT_CALL(policy_provider_, RegisterPolicyDomain(_)) |
| 177 .Times(AnyNumber()); | 177 .Times(AnyNumber()); |
| 178 policy::BrowserPolicyConnector::SetPolicyProviderForTesting( | 178 policy::BrowserPolicyConnector::SetPolicyProviderForTesting( |
| 179 &policy_provider_); | 179 &policy_provider_); |
| 180 }; | 180 }; |
| 181 | 181 |
| 182 void PreferencesBrowserTest::TearDownInProcessBrowserTestFixture() { | 182 void PreferencesBrowserTest::TearDownInProcessBrowserTestFixture() { |
| 183 STLDeleteElements(&default_values_); | 183 STLDeleteElements(&default_values_); |
| 184 STLDeleteElements(&non_default_values_); | 184 STLDeleteElements(&non_default_values_); |
| 185 } | 185 } |
| 186 | 186 |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 // Do not set the Boolean pref. It will toogle automatically. | 746 // Do not set the Boolean pref. It will toogle automatically. |
| 747 for (size_t i = 1; i < pref_names_.size(); ++i) | 747 for (size_t i = 1; i < pref_names_.size(); ++i) |
| 748 chromeos::proxy_cros_settings_parser::SetProxyPrefValue( | 748 chromeos::proxy_cros_settings_parser::SetProxyPrefValue( |
| 749 profile, pref_names_[i], non_default_values_[i]->DeepCopy()); | 749 profile, pref_names_[i], non_default_values_[i]->DeepCopy()); |
| 750 SetupJavaScriptTestEnvironment(pref_names_, &observed_json); | 750 SetupJavaScriptTestEnvironment(pref_names_, &observed_json); |
| 751 VerifyObservedPrefs(observed_json, pref_names_, non_default_values_, | 751 VerifyObservedPrefs(observed_json, pref_names_, non_default_values_, |
| 752 "", false, false); | 752 "", false, false); |
| 753 } | 753 } |
| 754 | 754 |
| 755 #endif | 755 #endif |
| OLD | NEW |