| 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/cronet/url_request_context_config.h" | 5 #include "components/cronet/url_request_context_config.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "net/cert/cert_verifier.h" | 9 #include "net/cert/cert_verifier.h" |
| 10 #include "net/http/http_network_session.h" | 10 #include "net/http/http_network_session.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 "", | 52 "", |
| 53 // Data reduction proxy. | 53 // Data reduction proxy. |
| 54 "", | 54 "", |
| 55 // Fallback data reduction proxy. | 55 // Fallback data reduction proxy. |
| 56 "", | 56 "", |
| 57 // Data reduction proxy secure proxy check URL. | 57 // Data reduction proxy secure proxy check URL. |
| 58 "", | 58 "", |
| 59 // MockCertVerifier to use for testing purposes. | 59 // MockCertVerifier to use for testing purposes. |
| 60 std::unique_ptr<net::CertVerifier>(), | 60 std::unique_ptr<net::CertVerifier>(), |
| 61 // Enable network quality estimator. | 61 // Enable network quality estimator. |
| 62 false, | 62 false); |
| 63 // Enable Public Key Pinning bypass for local trust anchors. | |
| 64 true); | |
| 65 | 63 |
| 66 net::URLRequestContextBuilder builder; | 64 net::URLRequestContextBuilder builder; |
| 67 net::NetLog net_log; | 65 net::NetLog net_log; |
| 68 config.ConfigureURLRequestContextBuilder(&builder, &net_log, nullptr); | 66 config.ConfigureURLRequestContextBuilder(&builder, &net_log, nullptr); |
| 69 // Set a ProxyConfigService to avoid DCHECK failure when building. | 67 // Set a ProxyConfigService to avoid DCHECK failure when building. |
| 70 builder.set_proxy_config_service(base::WrapUnique( | 68 builder.set_proxy_config_service(base::WrapUnique( |
| 71 new net::ProxyConfigServiceFixed(net::ProxyConfig::CreateDirect()))); | 69 new net::ProxyConfigServiceFixed(net::ProxyConfig::CreateDirect()))); |
| 72 std::unique_ptr<net::URLRequestContext> context(builder.Build()); | 70 std::unique_ptr<net::URLRequestContext> context(builder.Build()); |
| 73 const net::HttpNetworkSession::Params* params = | 71 const net::HttpNetworkSession::Params* params = |
| 74 context->GetNetworkSessionParams(); | 72 context->GetNetworkSessionParams(); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 "", | 131 "", |
| 134 // Data reduction proxy. | 132 // Data reduction proxy. |
| 135 "", | 133 "", |
| 136 // Fallback data reduction proxy. | 134 // Fallback data reduction proxy. |
| 137 "", | 135 "", |
| 138 // Data reduction proxy secure proxy check URL. | 136 // Data reduction proxy secure proxy check URL. |
| 139 "", | 137 "", |
| 140 // MockCertVerifier to use for testing purposes. | 138 // MockCertVerifier to use for testing purposes. |
| 141 std::unique_ptr<net::CertVerifier>(), | 139 std::unique_ptr<net::CertVerifier>(), |
| 142 // Enable network quality estimator. | 140 // Enable network quality estimator. |
| 143 false, | 141 false); |
| 144 // Enable Public Key Pinning bypass for local trust anchors. | |
| 145 true); | |
| 146 | 142 |
| 147 net::URLRequestContextBuilder builder; | 143 net::URLRequestContextBuilder builder; |
| 148 net::NetLog net_log; | 144 net::NetLog net_log; |
| 149 config.ConfigureURLRequestContextBuilder(&builder, &net_log, nullptr); | 145 config.ConfigureURLRequestContextBuilder(&builder, &net_log, nullptr); |
| 150 // Set a ProxyConfigService to avoid DCHECK failure when building. | 146 // Set a ProxyConfigService to avoid DCHECK failure when building. |
| 151 builder.set_proxy_config_service(base::WrapUnique( | 147 builder.set_proxy_config_service(base::WrapUnique( |
| 152 new net::ProxyConfigServiceFixed(net::ProxyConfig::CreateDirect()))); | 148 new net::ProxyConfigServiceFixed(net::ProxyConfig::CreateDirect()))); |
| 153 std::unique_ptr<net::URLRequestContext> context(builder.Build()); | 149 std::unique_ptr<net::URLRequestContext> context(builder.Build()); |
| 154 const net::HttpNetworkSession::Params* params = | 150 const net::HttpNetworkSession::Params* params = |
| 155 context->GetNetworkSessionParams(); | 151 context->GetNetworkSessionParams(); |
| 156 | 152 |
| 157 EXPECT_FALSE(params->quic_close_sessions_on_ip_change); | 153 EXPECT_FALSE(params->quic_close_sessions_on_ip_change); |
| 158 EXPECT_TRUE(params->quic_migrate_sessions_on_network_change); | 154 EXPECT_TRUE(params->quic_migrate_sessions_on_network_change); |
| 159 EXPECT_TRUE(params->quic_migrate_sessions_early); | 155 EXPECT_TRUE(params->quic_migrate_sessions_early); |
| 160 } | 156 } |
| 161 | 157 |
| 162 } // namespace cronet | 158 } // namespace cronet |
| OLD | NEW |