Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: components/cronet/url_request_context_config_unittest.cc

Issue 1507253003: [Cronet] Allow experimenting with Chrome's internal DNS resolver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nojson3
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "net/cert/cert_verifier.h" 7 #include "net/cert/cert_verifier.h"
8 #include "net/http/http_network_session.h" 8 #include "net/http/http_network_session.h"
9 #include "net/proxy/proxy_config.h" 9 #include "net/proxy/proxy_config.h"
10 #include "net/proxy/proxy_config_service_fixed.h" 10 #include "net/proxy/proxy_config_service_fixed.h"
(...skipping 20 matching lines...) Expand all
31 false, 31 false,
32 // Storage path for http cache and cookie storage. 32 // Storage path for http cache and cookie storage.
33 "/data/data/org.chromium.net/app_cronet_test/test_storage", 33 "/data/data/org.chromium.net/app_cronet_test/test_storage",
34 // User-Agent request header field. 34 // User-Agent request header field.
35 "fake agent", 35 "fake agent",
36 // JSON encoded experimental options. 36 // JSON encoded experimental options.
37 "{\"QUIC\":{\"store_server_configs_in_properties\":true," 37 "{\"QUIC\":{\"store_server_configs_in_properties\":true,"
38 "\"delay_tcp_race\":true," 38 "\"delay_tcp_race\":true,"
39 "\"max_number_of_lossy_connections\":10," 39 "\"max_number_of_lossy_connections\":10,"
40 "\"packet_loss_threshold\":0.5," 40 "\"packet_loss_threshold\":0.5,"
41 "\"connection_options\":\"TIME,TBBR,REJ\"}}", 41 "\"connection_options\":\"TIME,TBBR,REJ\"},"
42 "\"AsyncDNS\":{\"enable\":true}}",
42 // Data reduction proxy key. 43 // Data reduction proxy key.
43 "", 44 "",
44 // Data reduction proxy. 45 // Data reduction proxy.
45 "", 46 "",
46 // Fallback data reduction proxy. 47 // Fallback data reduction proxy.
47 "", 48 "",
48 // Data reduction proxy secure proxy check URL. 49 // Data reduction proxy secure proxy check URL.
49 "", 50 "",
50 // MockCertVerifier to use for testing purposes. 51 // MockCertVerifier to use for testing purposes.
51 scoped_ptr<net::CertVerifier>()); 52 scoped_ptr<net::CertVerifier>());
52 53
53 net::URLRequestContextBuilder builder; 54 net::URLRequestContextBuilder builder;
54 config.ConfigureURLRequestContextBuilder(&builder); 55 net::NetLog net_log;
56 config.ConfigureURLRequestContextBuilder(&builder, &net_log);
55 // Set a ProxyConfigService to avoid DCHECK failure when building. 57 // Set a ProxyConfigService to avoid DCHECK failure when building.
56 builder.set_proxy_config_service(make_scoped_ptr( 58 builder.set_proxy_config_service(make_scoped_ptr(
57 new net::ProxyConfigServiceFixed(net::ProxyConfig::CreateDirect()))); 59 new net::ProxyConfigServiceFixed(net::ProxyConfig::CreateDirect())));
58 scoped_ptr<net::URLRequestContext> context(builder.Build()); 60 scoped_ptr<net::URLRequestContext> context(builder.Build());
59 const net::HttpNetworkSession::Params* params = 61 const net::HttpNetworkSession::Params* params =
60 context->GetNetworkSessionParams(); 62 context->GetNetworkSessionParams();
61 // Check Quic Connection options. 63 // Check Quic Connection options.
62 net::QuicTagVector quic_connection_options; 64 net::QuicTagVector quic_connection_options;
63 quic_connection_options.push_back(net::kTIME); 65 quic_connection_options.push_back(net::kTIME);
64 quic_connection_options.push_back(net::kTBBR); 66 quic_connection_options.push_back(net::kTBBR);
65 quic_connection_options.push_back(net::kREJ); 67 quic_connection_options.push_back(net::kREJ);
66 EXPECT_EQ(quic_connection_options, params->quic_connection_options); 68 EXPECT_EQ(quic_connection_options, params->quic_connection_options);
67 69
68 // Check store_server_configs_in_properties. 70 // Check store_server_configs_in_properties.
69 EXPECT_TRUE(params->quic_store_server_configs_in_properties); 71 EXPECT_TRUE(params->quic_store_server_configs_in_properties);
70 72
71 // Check delay_tcp_race. 73 // Check delay_tcp_race.
72 EXPECT_TRUE(params->quic_delay_tcp_race); 74 EXPECT_TRUE(params->quic_delay_tcp_race);
73 75
74 // Check max_number_of_lossy_connections and packet_loss_threshold. 76 // Check max_number_of_lossy_connections and packet_loss_threshold.
75 EXPECT_EQ(10, params->quic_max_number_of_lossy_connections); 77 EXPECT_EQ(10, params->quic_max_number_of_lossy_connections);
76 EXPECT_FLOAT_EQ(0.5f, params->quic_packet_loss_threshold); 78 EXPECT_FLOAT_EQ(0.5f, params->quic_packet_loss_threshold);
79
80 // Check AsyncDNS resolver is enabled.
81 EXPECT_NE(nullptr, context->host_resolver()->GetDnsConfigAsValue());
77 } 82 }
78 83
79 } // namespace cronet 84 } // namespace cronet
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698