| 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/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/prefs/pref_registry_simple.h" | 10 #include "base/prefs/pref_registry_simple.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 108 |
| 109 private: | 109 private: |
| 110 scoped_ptr<PrefProxyConfigTrackerImpl> proxy_config_tracker_; | 110 scoped_ptr<PrefProxyConfigTrackerImpl> proxy_config_tracker_; |
| 111 content::TestBrowserThread ui_thread_; | 111 content::TestBrowserThread ui_thread_; |
| 112 content::TestBrowserThread io_thread_; | 112 content::TestBrowserThread io_thread_; |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 class PrefProxyConfigTrackerImplTest | 115 class PrefProxyConfigTrackerImplTest |
| 116 : public PrefProxyConfigTrackerImplTestBase<testing::Test> { | 116 : public PrefProxyConfigTrackerImplTestBase<testing::Test> { |
| 117 protected: | 117 protected: |
| 118 virtual void SetUp() { | 118 void SetUp() override { |
| 119 pref_service_.reset(new TestingPrefServiceSimple()); | 119 pref_service_.reset(new TestingPrefServiceSimple()); |
| 120 Init(pref_service_.get(), pref_service_->registry()); | 120 Init(pref_service_.get(), pref_service_->registry()); |
| 121 } | 121 } |
| 122 | 122 |
| 123 scoped_ptr<TestingPrefServiceSimple> pref_service_; | 123 scoped_ptr<TestingPrefServiceSimple> pref_service_; |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 TEST_F(PrefProxyConfigTrackerImplTest, BaseConfiguration) { | 126 TEST_F(PrefProxyConfigTrackerImplTest, BaseConfiguration) { |
| 127 net::ProxyConfig actual_config; | 127 net::ProxyConfig actual_config; |
| 128 EXPECT_EQ(net::ProxyConfigService::CONFIG_VALID, | 128 EXPECT_EQ(net::ProxyConfigService::CONFIG_VALID, |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 *os << params.description; | 321 *os << params.description; |
| 322 } | 322 } |
| 323 | 323 |
| 324 class PrefProxyConfigTrackerImplCommandLineTest | 324 class PrefProxyConfigTrackerImplCommandLineTest |
| 325 : public PrefProxyConfigTrackerImplTestBase< | 325 : public PrefProxyConfigTrackerImplTestBase< |
| 326 testing::TestWithParam<CommandLineTestParams> > { | 326 testing::TestWithParam<CommandLineTestParams> > { |
| 327 protected: | 327 protected: |
| 328 PrefProxyConfigTrackerImplCommandLineTest() | 328 PrefProxyConfigTrackerImplCommandLineTest() |
| 329 : command_line_(CommandLine::NO_PROGRAM) {} | 329 : command_line_(CommandLine::NO_PROGRAM) {} |
| 330 | 330 |
| 331 virtual void SetUp() { | 331 void SetUp() override { |
| 332 for (size_t i = 0; i < arraysize(GetParam().switches); i++) { | 332 for (size_t i = 0; i < arraysize(GetParam().switches); i++) { |
| 333 const char* name = GetParam().switches[i].name; | 333 const char* name = GetParam().switches[i].name; |
| 334 const char* value = GetParam().switches[i].value; | 334 const char* value = GetParam().switches[i].value; |
| 335 if (name && value) | 335 if (name && value) |
| 336 command_line_.AppendSwitchASCII(name, value); | 336 command_line_.AppendSwitchASCII(name, value); |
| 337 else if (name) | 337 else if (name) |
| 338 command_line_.AppendSwitch(name); | 338 command_line_.AppendSwitch(name); |
| 339 } | 339 } |
| 340 scoped_refptr<PrefRegistrySimple> registry = new PrefRegistrySimple; | 340 scoped_refptr<PrefRegistrySimple> registry = new PrefRegistrySimple; |
| 341 PrefServiceMockFactory factory; | 341 PrefServiceMockFactory factory; |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 net::ProxyRulesExpectation::Empty(), | 473 net::ProxyRulesExpectation::Empty(), |
| 474 }, | 474 }, |
| 475 }; | 475 }; |
| 476 | 476 |
| 477 INSTANTIATE_TEST_CASE_P( | 477 INSTANTIATE_TEST_CASE_P( |
| 478 PrefProxyConfigTrackerImplCommandLineTestInstance, | 478 PrefProxyConfigTrackerImplCommandLineTestInstance, |
| 479 PrefProxyConfigTrackerImplCommandLineTest, | 479 PrefProxyConfigTrackerImplCommandLineTest, |
| 480 testing::ValuesIn(kCommandLineTestParams)); | 480 testing::ValuesIn(kCommandLineTestParams)); |
| 481 | 481 |
| 482 } // namespace | 482 } // namespace |
| OLD | NEW |