| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/net/pref_proxy_config_tracker_impl.h" | 5 #include "chrome/browser/net/pref_proxy_config_tracker_impl.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/prefs/pref_registry_simple.h" | 10 #include "base/prefs/pref_registry_simple.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 }; | 128 }; |
| 129 | 129 |
| 130 TEST_F(PrefProxyConfigTrackerImplTest, BaseConfiguration) { | 130 TEST_F(PrefProxyConfigTrackerImplTest, BaseConfiguration) { |
| 131 net::ProxyConfig actual_config; | 131 net::ProxyConfig actual_config; |
| 132 EXPECT_EQ(net::ProxyConfigService::CONFIG_VALID, | 132 EXPECT_EQ(net::ProxyConfigService::CONFIG_VALID, |
| 133 proxy_config_service_->GetLatestProxyConfig(&actual_config)); | 133 proxy_config_service_->GetLatestProxyConfig(&actual_config)); |
| 134 EXPECT_EQ(GURL(kFixedPacUrl), actual_config.pac_url()); | 134 EXPECT_EQ(GURL(kFixedPacUrl), actual_config.pac_url()); |
| 135 } | 135 } |
| 136 | 136 |
| 137 TEST_F(PrefProxyConfigTrackerImplTest, DynamicPrefOverrides) { | 137 TEST_F(PrefProxyConfigTrackerImplTest, DynamicPrefOverrides) { |
| 138 pref_service_->SetManagedPref( | 138 pref_service_->SetManagedPref(prefs::kProxy, |
| 139 prefs::kProxy, | 139 ProxyConfigDictionary::CreateFixedServers( |
| 140 ProxyConfigDictionary::CreateFixedServers("http://example.com:3128", "")); | 140 "http://example.com:3128", std::string())); |
| 141 loop_.RunUntilIdle(); | 141 loop_.RunUntilIdle(); |
| 142 | 142 |
| 143 net::ProxyConfig actual_config; | 143 net::ProxyConfig actual_config; |
| 144 EXPECT_EQ(net::ProxyConfigService::CONFIG_VALID, | 144 EXPECT_EQ(net::ProxyConfigService::CONFIG_VALID, |
| 145 proxy_config_service_->GetLatestProxyConfig(&actual_config)); | 145 proxy_config_service_->GetLatestProxyConfig(&actual_config)); |
| 146 EXPECT_FALSE(actual_config.auto_detect()); | 146 EXPECT_FALSE(actual_config.auto_detect()); |
| 147 EXPECT_EQ(net::ProxyConfig::ProxyRules::TYPE_SINGLE_PROXY, | 147 EXPECT_EQ(net::ProxyConfig::ProxyRules::TYPE_SINGLE_PROXY, |
| 148 actual_config.proxy_rules().type); | 148 actual_config.proxy_rules().type); |
| 149 EXPECT_EQ(actual_config.proxy_rules().single_proxies.Get(), | 149 EXPECT_EQ(actual_config.proxy_rules().single_proxies.Get(), |
| 150 net::ProxyServer::FromURI("http://example.com:3128", | 150 net::ProxyServer::FromURI("http://example.com:3128", |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 net::ProxyRulesExpectation::Empty(), | 477 net::ProxyRulesExpectation::Empty(), |
| 478 }, | 478 }, |
| 479 }; | 479 }; |
| 480 | 480 |
| 481 INSTANTIATE_TEST_CASE_P( | 481 INSTANTIATE_TEST_CASE_P( |
| 482 PrefProxyConfigTrackerImplCommandLineTestInstance, | 482 PrefProxyConfigTrackerImplCommandLineTestInstance, |
| 483 PrefProxyConfigTrackerImplCommandLineTest, | 483 PrefProxyConfigTrackerImplCommandLineTest, |
| 484 testing::ValuesIn(kCommandLineTestParams)); | 484 testing::ValuesIn(kCommandLineTestParams)); |
| 485 | 485 |
| 486 } // namespace | 486 } // namespace |
| OLD | NEW |