| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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/network_session_configurator/network_session_configurator.h
" | 5 #include "components/network_session_configurator/network_session_configurator.h
" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 ParseFieldTrialsAndCommandLine(); | 51 ParseFieldTrialsAndCommandLine(); |
| 52 | 52 |
| 53 EXPECT_FALSE(params_.ignore_certificate_errors); | 53 EXPECT_FALSE(params_.ignore_certificate_errors); |
| 54 EXPECT_EQ("Chrome/52.0.2709.0 Linux x86_64", params_.quic_user_agent_id); | 54 EXPECT_EQ("Chrome/52.0.2709.0 Linux x86_64", params_.quic_user_agent_id); |
| 55 EXPECT_EQ(0u, params_.testing_fixed_http_port); | 55 EXPECT_EQ(0u, params_.testing_fixed_http_port); |
| 56 EXPECT_EQ(0u, params_.testing_fixed_https_port); | 56 EXPECT_EQ(0u, params_.testing_fixed_https_port); |
| 57 EXPECT_FALSE(params_.enable_spdy31); | 57 EXPECT_FALSE(params_.enable_spdy31); |
| 58 EXPECT_TRUE(params_.enable_http2); | 58 EXPECT_TRUE(params_.enable_http2); |
| 59 EXPECT_FALSE(params_.enable_tcp_fast_open_for_ssl); | 59 EXPECT_FALSE(params_.enable_tcp_fast_open_for_ssl); |
| 60 EXPECT_TRUE(params_.parse_alternative_services); | 60 EXPECT_TRUE(params_.parse_alternative_services); |
| 61 EXPECT_FALSE(params_.enable_alternative_service_with_different_host); | 61 EXPECT_TRUE(params_.enable_alternative_service_with_different_host); |
| 62 EXPECT_FALSE(params_.enable_npn); | 62 EXPECT_FALSE(params_.enable_npn); |
| 63 EXPECT_TRUE(params_.enable_priority_dependencies); | 63 EXPECT_TRUE(params_.enable_priority_dependencies); |
| 64 EXPECT_FALSE(params_.enable_quic); | 64 EXPECT_FALSE(params_.enable_quic); |
| 65 } | 65 } |
| 66 | 66 |
| 67 TEST_F(NetworkSessionConfiguratorTest, IgnoreCertificateErrors) { | 67 TEST_F(NetworkSessionConfiguratorTest, IgnoreCertificateErrors) { |
| 68 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 68 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 69 "ignore-certificate-errors"); | 69 "ignore-certificate-errors"); |
| 70 | 70 |
| 71 ParseFieldTrialsAndCommandLine(); | 71 ParseFieldTrialsAndCommandLine(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 84 EXPECT_EQ(42u, params_.testing_fixed_http_port); | 84 EXPECT_EQ(42u, params_.testing_fixed_http_port); |
| 85 EXPECT_EQ(1234u, params_.testing_fixed_https_port); | 85 EXPECT_EQ(1234u, params_.testing_fixed_https_port); |
| 86 } | 86 } |
| 87 | 87 |
| 88 TEST_F(NetworkSessionConfiguratorTest, AltSvcFieldTrialEnabled) { | 88 TEST_F(NetworkSessionConfiguratorTest, AltSvcFieldTrialEnabled) { |
| 89 base::FieldTrialList::CreateFieldTrial("ParseAltSvc", "AltSvcEnabled"); | 89 base::FieldTrialList::CreateFieldTrial("ParseAltSvc", "AltSvcEnabled"); |
| 90 | 90 |
| 91 ParseFieldTrials(); | 91 ParseFieldTrials(); |
| 92 | 92 |
| 93 EXPECT_TRUE(params_.parse_alternative_services); | 93 EXPECT_TRUE(params_.parse_alternative_services); |
| 94 EXPECT_FALSE(params_.enable_alternative_service_with_different_host); | 94 EXPECT_TRUE(params_.enable_alternative_service_with_different_host); |
| 95 } | 95 } |
| 96 | 96 |
| 97 TEST_F(NetworkSessionConfiguratorTest, AltSvcFieldTrialDisabled) { | 97 TEST_F(NetworkSessionConfiguratorTest, AltSvcFieldTrialDisabled) { |
| 98 base::FieldTrialList::CreateFieldTrial("ParseAltSvc", "AltSvcDisabled"); | 98 base::FieldTrialList::CreateFieldTrial("ParseAltSvc", "AltSvcDisabled"); |
| 99 | 99 |
| 100 ParseFieldTrials(); | 100 ParseFieldTrials(); |
| 101 | 101 |
| 102 EXPECT_FALSE(params_.parse_alternative_services); | 102 EXPECT_FALSE(params_.parse_alternative_services); |
| 103 EXPECT_FALSE(params_.enable_alternative_service_with_different_host); | 103 EXPECT_TRUE(params_.enable_alternative_service_with_different_host); |
| 104 } | 104 } |
| 105 | 105 |
| 106 TEST_F(NetworkSessionConfiguratorTest, SpdyFieldTrialHoldbackEnabled) { | 106 TEST_F(NetworkSessionConfiguratorTest, SpdyFieldTrialHoldbackEnabled) { |
| 107 net::HttpStreamFactory::set_spdy_enabled(true); | 107 net::HttpStreamFactory::set_spdy_enabled(true); |
| 108 base::FieldTrialList::CreateFieldTrial("SPDY", "SpdyDisabled"); | 108 base::FieldTrialList::CreateFieldTrial("SPDY", "SpdyDisabled"); |
| 109 | 109 |
| 110 ParseFieldTrials(); | 110 ParseFieldTrials(); |
| 111 | 111 |
| 112 EXPECT_FALSE(net::HttpStreamFactory::spdy_enabled()); | 112 EXPECT_FALSE(net::HttpStreamFactory::spdy_enabled()); |
| 113 } | 113 } |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 EXPECT_EQ(1350u, params_.quic_max_packet_length); | 208 EXPECT_EQ(1350u, params_.quic_max_packet_length); |
| 209 EXPECT_EQ(net::QuicTagVector(), params_.quic_connection_options); | 209 EXPECT_EQ(net::QuicTagVector(), params_.quic_connection_options); |
| 210 EXPECT_FALSE(params_.quic_always_require_handshake_confirmation); | 210 EXPECT_FALSE(params_.quic_always_require_handshake_confirmation); |
| 211 EXPECT_FALSE(params_.quic_disable_connection_pooling); | 211 EXPECT_FALSE(params_.quic_disable_connection_pooling); |
| 212 EXPECT_EQ(0.25f, params_.quic_load_server_info_timeout_srtt_multiplier); | 212 EXPECT_EQ(0.25f, params_.quic_load_server_info_timeout_srtt_multiplier); |
| 213 EXPECT_FALSE(params_.quic_enable_connection_racing); | 213 EXPECT_FALSE(params_.quic_enable_connection_racing); |
| 214 EXPECT_FALSE(params_.quic_enable_non_blocking_io); | 214 EXPECT_FALSE(params_.quic_enable_non_blocking_io); |
| 215 EXPECT_FALSE(params_.quic_disable_disk_cache); | 215 EXPECT_FALSE(params_.quic_disable_disk_cache); |
| 216 EXPECT_FALSE(params_.quic_prefer_aes); | 216 EXPECT_FALSE(params_.quic_prefer_aes); |
| 217 EXPECT_TRUE(params_.parse_alternative_services); | 217 EXPECT_TRUE(params_.parse_alternative_services); |
| 218 EXPECT_FALSE(params_.enable_alternative_service_with_different_host); | 218 EXPECT_TRUE(params_.enable_alternative_service_with_different_host); |
| 219 EXPECT_EQ(0, params_.quic_max_number_of_lossy_connections); | 219 EXPECT_EQ(0, params_.quic_max_number_of_lossy_connections); |
| 220 EXPECT_EQ(1.0f, params_.quic_packet_loss_threshold); | 220 EXPECT_EQ(1.0f, params_.quic_packet_loss_threshold); |
| 221 EXPECT_TRUE(params_.quic_delay_tcp_race); | 221 EXPECT_TRUE(params_.quic_delay_tcp_race); |
| 222 EXPECT_FALSE(params_.quic_close_sessions_on_ip_change); | 222 EXPECT_FALSE(params_.quic_close_sessions_on_ip_change); |
| 223 EXPECT_EQ(net::kIdleConnectionTimeoutSeconds, | 223 EXPECT_EQ(net::kIdleConnectionTimeoutSeconds, |
| 224 params_.quic_idle_connection_timeout_seconds); | 224 params_.quic_idle_connection_timeout_seconds); |
| 225 EXPECT_FALSE(params_.quic_disable_preconnect_if_0rtt); | 225 EXPECT_FALSE(params_.quic_disable_preconnect_if_0rtt); |
| 226 EXPECT_FALSE(params_.quic_migrate_sessions_on_network_change); | 226 EXPECT_FALSE(params_.quic_migrate_sessions_on_network_change); |
| 227 EXPECT_FALSE(params_.quic_migrate_sessions_early); | 227 EXPECT_FALSE(params_.quic_migrate_sessions_early); |
| 228 EXPECT_TRUE(params_.quic_host_whitelist.empty()); | 228 EXPECT_TRUE(params_.quic_host_whitelist.empty()); |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 | 627 |
| 628 TEST_F(NetworkSessionConfiguratorTest, TCPFastOpenHttpsEnabled) { | 628 TEST_F(NetworkSessionConfiguratorTest, TCPFastOpenHttpsEnabled) { |
| 629 base::FieldTrialList::CreateFieldTrial("TCPFastOpen", "HttpsEnabled"); | 629 base::FieldTrialList::CreateFieldTrial("TCPFastOpen", "HttpsEnabled"); |
| 630 | 630 |
| 631 ParseFieldTrials(); | 631 ParseFieldTrials(); |
| 632 | 632 |
| 633 EXPECT_TRUE(params_.enable_tcp_fast_open_for_ssl); | 633 EXPECT_TRUE(params_.enable_tcp_fast_open_for_ssl); |
| 634 } | 634 } |
| 635 | 635 |
| 636 } // namespace test | 636 } // namespace test |
| OLD | NEW |