| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
ig_service.h" | 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
ig_service.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 class MockObserver : public net::ProxyConfigService::Observer { | 71 class MockObserver : public net::ProxyConfigService::Observer { |
| 72 public: | 72 public: |
| 73 MOCK_METHOD2(OnProxyConfigChanged, | 73 MOCK_METHOD2(OnProxyConfigChanged, |
| 74 void(const net::ProxyConfig&, | 74 void(const net::ProxyConfig&, |
| 75 net::ProxyConfigService::ConfigAvailability)); | 75 net::ProxyConfigService::ConfigAvailability)); |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 | 78 |
| 79 class DataReductionProxyConfigServiceTest : public testing::Test { | 79 class DataReductionProxyConfigServiceTest : public testing::Test { |
| 80 public: | 80 public: |
| 81 virtual void SetUp() { | 81 void SetUp() override { |
| 82 observer_.reset(new MockObserver()); | 82 observer_.reset(new MockObserver()); |
| 83 base_service_ = new TestProxyConfigService(); | 83 base_service_ = new TestProxyConfigService(); |
| 84 scoped_ptr<net::ProxyConfigService> base_service(base_service_); | 84 scoped_ptr<net::ProxyConfigService> base_service(base_service_); |
| 85 config_service_.reset( | 85 config_service_.reset( |
| 86 new DataReductionProxyConfigService(base_service.Pass())); | 86 new DataReductionProxyConfigService(base_service.Pass())); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void EnableDataReductionProxy(bool data_reduction_proxy_enabled) { | 89 void EnableDataReductionProxy(bool data_reduction_proxy_enabled) { |
| 90 config_service_->enabled_ = data_reduction_proxy_enabled; | 90 config_service_->enabled_ = data_reduction_proxy_enabled; |
| 91 config_service_->config_.proxy_rules().ParseFromString( | 91 config_service_->config_.proxy_rules().ParseFromString( |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 | 296 |
| 297 ASSERT_EQ(tracker.bypass_rules_.size(), 6u); | 297 ASSERT_EQ(tracker.bypass_rules_.size(), 6u); |
| 298 int i = 0; | 298 int i = 0; |
| 299 for (std::vector<std::string>::iterator it = tracker.bypass_rules_.begin(); | 299 for (std::vector<std::string>::iterator it = tracker.bypass_rules_.begin(); |
| 300 it != tracker.bypass_rules_.end(); ++it) { | 300 it != tracker.bypass_rules_.end(); ++it) { |
| 301 EXPECT_EQ(expected[i++], *it); | 301 EXPECT_EQ(expected[i++], *it); |
| 302 } | 302 } |
| 303 } | 303 } |
| 304 | 304 |
| 305 } // namespace data_reduction_proxy | 305 } // namespace data_reduction_proxy |
| OLD | NEW |