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_service_client.h" | 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
ig_service_client.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 #include <stdint.h> |
| 9 |
7 #include <string> | 10 #include <string> |
8 #include <vector> | 11 #include <vector> |
9 | 12 |
10 #include "base/base64.h" | 13 #include "base/base64.h" |
11 #include "base/command_line.h" | 14 #include "base/command_line.h" |
12 #include "base/macros.h" | 15 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
14 #include "base/metrics/field_trial.h" | 17 #include "base/metrics/field_trial.h" |
15 #include "base/test/histogram_tester.h" | 18 #include "base/test/histogram_tester.h" |
16 #include "base/test/mock_entropy_provider.h" | 19 #include "base/test/mock_entropy_provider.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 const int kConfingRefreshDurationSeconds = 600; | 58 const int kConfingRefreshDurationSeconds = 600; |
56 | 59 |
57 } // namespace | 60 } // namespace |
58 | 61 |
59 namespace data_reduction_proxy { | 62 namespace data_reduction_proxy { |
60 | 63 |
61 namespace { | 64 namespace { |
62 | 65 |
63 // Creates a new ClientConfig from the given parameters. | 66 // Creates a new ClientConfig from the given parameters. |
64 ClientConfig CreateConfig(const std::string& session_key, | 67 ClientConfig CreateConfig(const std::string& session_key, |
65 int64 expire_duration_seconds, | 68 int64_t expire_duration_seconds, |
66 int64 expire_duration_nanoseconds, | 69 int64_t expire_duration_nanoseconds, |
67 ProxyServer_ProxyScheme primary_scheme, | 70 ProxyServer_ProxyScheme primary_scheme, |
68 const std::string& primary_host, | 71 const std::string& primary_host, |
69 int primary_port, | 72 int primary_port, |
70 ProxyServer_ProxyScheme secondary_scheme, | 73 ProxyServer_ProxyScheme secondary_scheme, |
71 const std::string& secondary_host, | 74 const std::string& secondary_host, |
72 int secondary_port) { | 75 int secondary_port) { |
73 ClientConfig config; | 76 ClientConfig config; |
74 | 77 |
75 config.set_session_key(session_key); | 78 config.set_session_key(session_key); |
76 config.mutable_refresh_duration()->set_seconds(expire_duration_seconds); | 79 config.mutable_refresh_duration()->set_seconds(expire_duration_seconds); |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 | 598 |
596 // ApplySerializedConfig should apply the encoded config. | 599 // ApplySerializedConfig should apply the encoded config. |
597 config_client()->ApplySerializedConfig(encoded_config()); | 600 config_client()->ApplySerializedConfig(encoded_config()); |
598 EXPECT_EQ(2U, configurator()->proxies_for_http().size()); | 601 EXPECT_EQ(2U, configurator()->proxies_for_http().size()); |
599 EXPECT_TRUE(configurator()->proxies_for_https().empty()); | 602 EXPECT_TRUE(configurator()->proxies_for_https().empty()); |
600 EXPECT_TRUE(persisted_config().empty()); | 603 EXPECT_TRUE(persisted_config().empty()); |
601 EXPECT_FALSE(request_options()->GetSecureSession().empty()); | 604 EXPECT_FALSE(request_options()->GetSecureSession().empty()); |
602 } | 605 } |
603 | 606 |
604 } // namespace data_reduction_proxy | 607 } // namespace data_reduction_proxy |
OLD | NEW |