| 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_metr
ics.h" | 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_metr
ics.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 using net::MockRead; | 29 using net::MockRead; |
| 30 | 30 |
| 31 namespace data_reduction_proxy { | 31 namespace data_reduction_proxy { |
| 32 | 32 |
| 33 TEST(ChromeNetworkDailyDataSavingMetricsTest, | 33 TEST(ChromeNetworkDailyDataSavingMetricsTest, |
| 34 GetDataReductionProxyRequestType) { | 34 GetDataReductionProxyRequestType) { |
| 35 base::MessageLoopForIO message_loop; | 35 base::MessageLoopForIO message_loop; |
| 36 std::unique_ptr<DataReductionProxyTestContext> test_context = | 36 std::unique_ptr<DataReductionProxyTestContext> test_context = |
| 37 DataReductionProxyTestContext::Builder() | 37 DataReductionProxyTestContext::Builder() |
| 38 .WithParamsFlags(0) | |
| 39 .WithParamsDefinitions(TestDataReductionProxyParams::HAS_ORIGIN) | |
| 40 .Build(); | 38 .Build(); |
| 41 TestDataReductionProxyConfig* config = test_context->config(); | 39 TestDataReductionProxyConfig* config = test_context->config(); |
| 42 | 40 |
| 43 net::ProxyServer origin = | 41 net::ProxyServer origin = |
| 44 config->test_params()->proxies_for_http().front().proxy_server(); | 42 config->test_params()->proxies_for_http().front().proxy_server(); |
| 45 net::ProxyConfig data_reduction_proxy_config; | 43 net::ProxyConfig data_reduction_proxy_config; |
| 46 data_reduction_proxy_config.proxy_rules().ParseFromString( | 44 data_reduction_proxy_config.proxy_rules().ParseFromString( |
| 47 "http=" + origin.host_port_pair().ToString() + ",direct://"); | 45 "http=" + origin.host_port_pair().ToString() + ",direct://"); |
| 48 data_reduction_proxy_config.proxy_rules().bypass_rules.ParseFromString( | 46 data_reduction_proxy_config.proxy_rules().bypass_rules.ParseFromString( |
| 49 "localbypass.com"); | 47 "localbypass.com"); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 } | 195 } |
| 198 | 196 |
| 199 EXPECT_EQ(test_case.expected_request_type, | 197 EXPECT_EQ(test_case.expected_request_type, |
| 200 GetDataReductionProxyRequestType( | 198 GetDataReductionProxyRequestType( |
| 201 *request, data_reduction_proxy_config, | 199 *request, data_reduction_proxy_config, |
| 202 *test_context->config())); | 200 *test_context->config())); |
| 203 } | 201 } |
| 204 } | 202 } |
| 205 | 203 |
| 206 } // namespace data_reduction_proxy | 204 } // namespace data_reduction_proxy |
| OLD | NEW |