| 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/values.h" | 7 #include "base/values.h" |
| 8 #include "net/cert/cert_verifier.h" | 8 #include "net/cert/cert_verifier.h" |
| 9 #include "net/http/http_network_session.h" | 9 #include "net/http/http_network_session.h" |
| 10 #include "net/proxy/proxy_config.h" | 10 #include "net/proxy/proxy_config.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // Max size of http cache in bytes. | 28 // Max size of http cache in bytes. |
| 29 1024000, | 29 1024000, |
| 30 // Disable caching for HTTP responses. Other information may be stored in | 30 // Disable caching for HTTP responses. Other information may be stored in |
| 31 // the cache. | 31 // the cache. |
| 32 false, | 32 false, |
| 33 // Storage path for http cache and cookie storage. | 33 // Storage path for http cache and cookie storage. |
| 34 "/data/data/org.chromium.net/app_cronet_test/test_storage", | 34 "/data/data/org.chromium.net/app_cronet_test/test_storage", |
| 35 // User-Agent request header field. | 35 // User-Agent request header field. |
| 36 "fake agent", | 36 "fake agent", |
| 37 // JSON encoded experimental options. | 37 // JSON encoded experimental options. |
| 38 "{\"QUIC\":{\"store_server_configs_in_properties\":true," | 38 "{\"QUIC\":{\"max_server_configs_stored_in_properties\":2," |
| 39 "\"delay_tcp_race\":true," | 39 "\"delay_tcp_race\":true," |
| 40 "\"max_number_of_lossy_connections\":10," | 40 "\"max_number_of_lossy_connections\":10," |
| 41 "\"packet_loss_threshold\":0.5," | 41 "\"packet_loss_threshold\":0.5," |
| 42 "\"idle_connection_timeout_seconds\":300," | 42 "\"idle_connection_timeout_seconds\":300," |
| 43 "\"connection_options\":\"TIME,TBBR,REJ\"}," | 43 "\"connection_options\":\"TIME,TBBR,REJ\"}," |
| 44 "\"AsyncDNS\":{\"enable\":true}}", | 44 "\"AsyncDNS\":{\"enable\":true}}", |
| 45 // Data reduction proxy key. | 45 // Data reduction proxy key. |
| 46 "", | 46 "", |
| 47 // Data reduction proxy. | 47 // Data reduction proxy. |
| 48 "", | 48 "", |
| (...skipping 13 matching lines...) Expand all Loading... |
| 62 scoped_ptr<net::URLRequestContext> context(builder.Build()); | 62 scoped_ptr<net::URLRequestContext> context(builder.Build()); |
| 63 const net::HttpNetworkSession::Params* params = | 63 const net::HttpNetworkSession::Params* params = |
| 64 context->GetNetworkSessionParams(); | 64 context->GetNetworkSessionParams(); |
| 65 // Check Quic Connection options. | 65 // Check Quic Connection options. |
| 66 net::QuicTagVector quic_connection_options; | 66 net::QuicTagVector quic_connection_options; |
| 67 quic_connection_options.push_back(net::kTIME); | 67 quic_connection_options.push_back(net::kTIME); |
| 68 quic_connection_options.push_back(net::kTBBR); | 68 quic_connection_options.push_back(net::kTBBR); |
| 69 quic_connection_options.push_back(net::kREJ); | 69 quic_connection_options.push_back(net::kREJ); |
| 70 EXPECT_EQ(quic_connection_options, params->quic_connection_options); | 70 EXPECT_EQ(quic_connection_options, params->quic_connection_options); |
| 71 | 71 |
| 72 // Check store_server_configs_in_properties. | 72 // Check max_server_configs_stored_in_properties. |
| 73 EXPECT_TRUE(params->quic_store_server_configs_in_properties); | 73 EXPECT_EQ(2u, params->quic_max_server_configs_stored_in_properties); |
| 74 | 74 |
| 75 // Check delay_tcp_race. | 75 // Check delay_tcp_race. |
| 76 EXPECT_TRUE(params->quic_delay_tcp_race); | 76 EXPECT_TRUE(params->quic_delay_tcp_race); |
| 77 | 77 |
| 78 // Check max_number_of_lossy_connections and packet_loss_threshold. | 78 // Check max_number_of_lossy_connections and packet_loss_threshold. |
| 79 EXPECT_EQ(10, params->quic_max_number_of_lossy_connections); | 79 EXPECT_EQ(10, params->quic_max_number_of_lossy_connections); |
| 80 EXPECT_FLOAT_EQ(0.5f, params->quic_packet_loss_threshold); | 80 EXPECT_FLOAT_EQ(0.5f, params->quic_packet_loss_threshold); |
| 81 | 81 |
| 82 // Check idle_connection_timeout_seconds. | 82 // Check idle_connection_timeout_seconds. |
| 83 EXPECT_EQ(300, params->quic_idle_connection_timeout_seconds); | 83 EXPECT_EQ(300, params->quic_idle_connection_timeout_seconds); |
| 84 | 84 |
| 85 // Check AsyncDNS resolver is enabled. | 85 // Check AsyncDNS resolver is enabled. |
| 86 EXPECT_TRUE(context->host_resolver()->GetDnsConfigAsValue()); | 86 EXPECT_TRUE(context->host_resolver()->GetDnsConfigAsValue()); |
| 87 } | 87 } |
| 88 | 88 |
| 89 } // namespace cronet | 89 } // namespace cronet |
| OLD | NEW |