| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 prefs::kProxy, | 139 prefs::kProxy, |
| 140 ProxyConfigDictionary::CreateFixedServers("http://example.com:3128", "")); | 140 ProxyConfigDictionary::CreateFixedServers("http://example.com:3128", "")); |
| 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_proxy, | 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", |
| 151 net::ProxyServer::SCHEME_HTTP)); | 151 net::ProxyServer::SCHEME_HTTP)); |
| 152 | 152 |
| 153 pref_service_->SetManagedPref(prefs::kProxy, | 153 pref_service_->SetManagedPref(prefs::kProxy, |
| 154 ProxyConfigDictionary::CreateAutoDetect()); | 154 ProxyConfigDictionary::CreateAutoDetect()); |
| 155 loop_.RunUntilIdle(); | 155 loop_.RunUntilIdle(); |
| 156 | 156 |
| 157 EXPECT_EQ(net::ProxyConfigService::CONFIG_VALID, | 157 EXPECT_EQ(net::ProxyConfigService::CONFIG_VALID, |
| 158 proxy_config_service_->GetLatestProxyConfig(&actual_config)); | 158 proxy_config_service_->GetLatestProxyConfig(&actual_config)); |
| 159 EXPECT_TRUE(actual_config.auto_detect()); | 159 EXPECT_TRUE(actual_config.auto_detect()); |
| (...skipping 317 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 |