| 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/callback.h" | 10 #include "base/callback.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #include "chromeos/dbus/shill_service_client.h" | 46 #include "chromeos/dbus/shill_service_client.h" |
| 47 #include "chromeos/network/favorite_state.h" | 47 #include "chromeos/network/favorite_state.h" |
| 48 #include "chromeos/network/network_state.h" | 48 #include "chromeos/network/network_state.h" |
| 49 #include "chromeos/network/network_state_handler.h" | 49 #include "chromeos/network/network_state_handler.h" |
| 50 #include "chromeos/settings/cros_settings_names.h" | 50 #include "chromeos/settings/cros_settings_names.h" |
| 51 #include "content/public/test/test_utils.h" | 51 #include "content/public/test/test_utils.h" |
| 52 #include "third_party/cros_system_api/dbus/service_constants.h" | 52 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 53 #endif | 53 #endif |
| 54 | 54 |
| 55 using testing::AllOf; | 55 using testing::AllOf; |
| 56 using testing::AnyNumber; | |
| 57 using testing::Mock; | 56 using testing::Mock; |
| 58 using testing::Property; | 57 using testing::Property; |
| 59 using testing::Return; | 58 using testing::Return; |
| 60 using testing::_; | 59 using testing::_; |
| 61 | 60 |
| 62 namespace base { | 61 namespace base { |
| 63 | 62 |
| 64 // Helper for using EXPECT_EQ() with base::Value. | 63 // Helper for using EXPECT_EQ() with base::Value. |
| 65 bool operator==(const Value& first, const Value& second) { | 64 bool operator==(const Value& first, const Value& second) { |
| 66 return first.Equals(&second); | 65 return first.Equals(&second); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 183 |
| 185 // Forwards notifications received when pref values change in the backend. | 184 // Forwards notifications received when pref values change in the backend. |
| 186 void PreferencesBrowserTest::OnPreferenceChanged(const std::string& pref_name) { | 185 void PreferencesBrowserTest::OnPreferenceChanged(const std::string& pref_name) { |
| 187 OnCommit(pref_service_->FindPreference(pref_name.c_str())); | 186 OnCommit(pref_service_->FindPreference(pref_name.c_str())); |
| 188 } | 187 } |
| 189 | 188 |
| 190 void PreferencesBrowserTest::SetUpInProcessBrowserTestFixture() { | 189 void PreferencesBrowserTest::SetUpInProcessBrowserTestFixture() { |
| 191 // Sets up a mock policy provider for user and device policies. | 190 // Sets up a mock policy provider for user and device policies. |
| 192 EXPECT_CALL(policy_provider_, IsInitializationComplete(_)) | 191 EXPECT_CALL(policy_provider_, IsInitializationComplete(_)) |
| 193 .WillRepeatedly(Return(true)); | 192 .WillRepeatedly(Return(true)); |
| 194 EXPECT_CALL(policy_provider_, RegisterPolicyDomain(_)) | |
| 195 .Times(AnyNumber()); | |
| 196 policy::BrowserPolicyConnector::SetPolicyProviderForTesting( | 193 policy::BrowserPolicyConnector::SetPolicyProviderForTesting( |
| 197 &policy_provider_); | 194 &policy_provider_); |
| 198 }; | 195 }; |
| 199 | 196 |
| 200 void PreferencesBrowserTest::TearDownInProcessBrowserTestFixture() { | 197 void PreferencesBrowserTest::TearDownInProcessBrowserTestFixture() { |
| 201 STLDeleteElements(&default_values_); | 198 STLDeleteElements(&default_values_); |
| 202 STLDeleteElements(&non_default_values_); | 199 STLDeleteElements(&non_default_values_); |
| 203 } | 200 } |
| 204 | 201 |
| 205 void PreferencesBrowserTest::SetUserPolicies( | 202 void PreferencesBrowserTest::SetUserPolicies( |
| (...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 996 SetProxyPref(chromeos::kProxyHttpsPort, base::FundamentalValue(2)); | 993 SetProxyPref(chromeos::kProxyHttpsPort, base::FundamentalValue(2)); |
| 997 SetProxyPref(chromeos::kProxyFtpPort, base::FundamentalValue(3)); | 994 SetProxyPref(chromeos::kProxyFtpPort, base::FundamentalValue(3)); |
| 998 SetProxyPref(chromeos::kProxySocksPort, base::FundamentalValue(4)); | 995 SetProxyPref(chromeos::kProxySocksPort, base::FundamentalValue(4)); |
| 999 | 996 |
| 1000 VerifyCurrentProxyServer( | 997 VerifyCurrentProxyServer( |
| 1001 "http=a.com:1;https=4.3.2.1:2;ftp=c.com:3;socks=socks4://d.com:4", | 998 "http=a.com:1;https=4.3.2.1:2;ftp=c.com:3;socks=socks4://d.com:4", |
| 1002 onc::ONC_SOURCE_NONE); | 999 onc::ONC_SOURCE_NONE); |
| 1003 } | 1000 } |
| 1004 | 1001 |
| 1005 #endif | 1002 #endif |
| OLD | NEW |