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; | 56 using testing::AnyNumber; |
bartfab (slow)
2013/11/05 15:53:04
Nit: No longer used.
Joao da Silva
2013/11/07 13:15:00
Done.
| |
57 using testing::Mock; | 57 using testing::Mock; |
58 using testing::Property; | 58 using testing::Property; |
59 using testing::Return; | 59 using testing::Return; |
60 using testing::_; | 60 using testing::_; |
61 | 61 |
62 namespace base { | 62 namespace base { |
63 | 63 |
64 // Helper for using EXPECT_EQ() with base::Value. | 64 // Helper for using EXPECT_EQ() with base::Value. |
65 bool operator==(const Value& first, const Value& second) { | 65 bool operator==(const Value& first, const Value& second) { |
66 return first.Equals(&second); | 66 return first.Equals(&second); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
184 | 184 |
185 // Forwards notifications received when pref values change in the backend. | 185 // Forwards notifications received when pref values change in the backend. |
186 void PreferencesBrowserTest::OnPreferenceChanged(const std::string& pref_name) { | 186 void PreferencesBrowserTest::OnPreferenceChanged(const std::string& pref_name) { |
187 OnCommit(pref_service_->FindPreference(pref_name.c_str())); | 187 OnCommit(pref_service_->FindPreference(pref_name.c_str())); |
188 } | 188 } |
189 | 189 |
190 void PreferencesBrowserTest::SetUpInProcessBrowserTestFixture() { | 190 void PreferencesBrowserTest::SetUpInProcessBrowserTestFixture() { |
191 // Sets up a mock policy provider for user and device policies. | 191 // Sets up a mock policy provider for user and device policies. |
192 EXPECT_CALL(policy_provider_, IsInitializationComplete(_)) | 192 EXPECT_CALL(policy_provider_, IsInitializationComplete(_)) |
193 .WillRepeatedly(Return(true)); | 193 .WillRepeatedly(Return(true)); |
194 EXPECT_CALL(policy_provider_, RegisterPolicyDomain(_)) | |
195 .Times(AnyNumber()); | |
196 policy::BrowserPolicyConnector::SetPolicyProviderForTesting( | 194 policy::BrowserPolicyConnector::SetPolicyProviderForTesting( |
197 &policy_provider_); | 195 &policy_provider_); |
198 }; | 196 }; |
199 | 197 |
200 void PreferencesBrowserTest::TearDownInProcessBrowserTestFixture() { | 198 void PreferencesBrowserTest::TearDownInProcessBrowserTestFixture() { |
201 STLDeleteElements(&default_values_); | 199 STLDeleteElements(&default_values_); |
202 STLDeleteElements(&non_default_values_); | 200 STLDeleteElements(&non_default_values_); |
203 } | 201 } |
204 | 202 |
205 void PreferencesBrowserTest::SetUserPolicies( | 203 void PreferencesBrowserTest::SetUserPolicies( |
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
996 SetProxyPref(chromeos::kProxyHttpsPort, base::FundamentalValue(2)); | 994 SetProxyPref(chromeos::kProxyHttpsPort, base::FundamentalValue(2)); |
997 SetProxyPref(chromeos::kProxyFtpPort, base::FundamentalValue(3)); | 995 SetProxyPref(chromeos::kProxyFtpPort, base::FundamentalValue(3)); |
998 SetProxyPref(chromeos::kProxySocksPort, base::FundamentalValue(4)); | 996 SetProxyPref(chromeos::kProxySocksPort, base::FundamentalValue(4)); |
999 | 997 |
1000 VerifyCurrentProxyServer( | 998 VerifyCurrentProxyServer( |
1001 "http=a.com:1;https=4.3.2.1:2;ftp=c.com:3;socks=socks4://d.com:4", | 999 "http=a.com:1;https=4.3.2.1:2;ftp=c.com:3;socks=socks4://d.com:4", |
1002 onc::ONC_SOURCE_NONE); | 1000 onc::ONC_SOURCE_NONE); |
1003 } | 1001 } |
1004 | 1002 |
1005 #endif | 1003 #endif |
OLD | NEW |