| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.h" | 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
ig.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
ig_test_utils.h" | 9 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
ig_test_utils.h" |
| 10 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
igurator_test_utils.h" | 10 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
igurator_test_utils.h" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 172 |
| 173 TestDataReductionProxyConfigurator* configurator() { | 173 TestDataReductionProxyConfigurator* configurator() { |
| 174 return test_context_->test_configurator(); | 174 return test_context_->test_configurator(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 TestDataReductionProxyParams* params() const { | 177 TestDataReductionProxyParams* params() const { |
| 178 return expected_params_.get(); | 178 return expected_params_.get(); |
| 179 } | 179 } |
| 180 | 180 |
| 181 private: | 181 private: |
| 182 base::MessageLoopForIO message_loop_; |
| 182 scoped_ptr<DataReductionProxyTestContext> test_context_; | 183 scoped_ptr<DataReductionProxyTestContext> test_context_; |
| 183 scoped_ptr<TestDataReductionProxyParams> expected_params_; | 184 scoped_ptr<TestDataReductionProxyParams> expected_params_; |
| 184 }; | 185 }; |
| 185 | 186 |
| 186 TEST_F(DataReductionProxyConfigTest, TestUpdateConfigurator) { | 187 TEST_F(DataReductionProxyConfigTest, TestUpdateConfigurator) { |
| 187 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( | 188 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
| 188 switches::kDataReductionProxyAlt, params()->DefaultAltOrigin()); | 189 switches::kDataReductionProxyAlt, params()->DefaultAltOrigin()); |
| 189 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( | 190 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
| 190 switches::kDataReductionProxyAltFallback, | 191 switches::kDataReductionProxyAltFallback, |
| 191 params()->DefaultAltFallbackOrigin()); | 192 params()->DefaultAltFallbackOrigin()); |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 base::TimeDelta min_retry_delay; | 759 base::TimeDelta min_retry_delay; |
| 759 was_bypassed = config->AreProxiesBypassed(retry_map, | 760 was_bypassed = config->AreProxiesBypassed(retry_map, |
| 760 rules, | 761 rules, |
| 761 false, | 762 false, |
| 762 &min_retry_delay); | 763 &min_retry_delay); |
| 763 EXPECT_TRUE(was_bypassed); | 764 EXPECT_TRUE(was_bypassed); |
| 764 EXPECT_EQ(delay, min_retry_delay); | 765 EXPECT_EQ(delay, min_retry_delay); |
| 765 } | 766 } |
| 766 | 767 |
| 767 } // namespace data_reduction_proxy | 768 } // namespace data_reduction_proxy |
| OLD | NEW |