OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 TEST_F(NetworkSessionConfiguratorTest, Defaults) { | 84 TEST_F(NetworkSessionConfiguratorTest, Defaults) { |
85 ParseFieldTrialsAndCommandLine(); | 85 ParseFieldTrialsAndCommandLine(); |
86 | 86 |
87 EXPECT_FALSE(params_.ignore_certificate_errors); | 87 EXPECT_FALSE(params_.ignore_certificate_errors); |
88 EXPECT_EQ(0u, params_.testing_fixed_http_port); | 88 EXPECT_EQ(0u, params_.testing_fixed_http_port); |
89 EXPECT_EQ(0u, params_.testing_fixed_https_port); | 89 EXPECT_EQ(0u, params_.testing_fixed_https_port); |
90 EXPECT_FALSE(params_.enable_spdy31); | 90 EXPECT_FALSE(params_.enable_spdy31); |
91 EXPECT_TRUE(params_.enable_http2); | 91 EXPECT_TRUE(params_.enable_http2); |
92 EXPECT_FALSE(params_.enable_tcp_fast_open_for_ssl); | 92 EXPECT_FALSE(params_.enable_tcp_fast_open_for_ssl); |
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 EXPECT_FALSE(params_.enable_npn); | 95 EXPECT_FALSE(params_.enable_npn); |
96 EXPECT_TRUE(params_.enable_priority_dependencies); | 96 EXPECT_TRUE(params_.enable_priority_dependencies); |
97 EXPECT_FALSE(params_.enable_quic); | 97 EXPECT_FALSE(params_.enable_quic); |
98 } | 98 } |
99 | 99 |
100 TEST_F(NetworkSessionConfiguratorTest, IgnoreCertificateErrors) { | 100 TEST_F(NetworkSessionConfiguratorTest, IgnoreCertificateErrors) { |
101 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 101 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
102 "ignore-certificate-errors"); | 102 "ignore-certificate-errors"); |
103 | 103 |
104 ParseFieldTrialsAndCommandLine(); | 104 ParseFieldTrialsAndCommandLine(); |
(...skipping 12 matching lines...) Expand all Loading... |
117 EXPECT_EQ(42u, params_.testing_fixed_http_port); | 117 EXPECT_EQ(42u, params_.testing_fixed_http_port); |
118 EXPECT_EQ(1234u, params_.testing_fixed_https_port); | 118 EXPECT_EQ(1234u, params_.testing_fixed_https_port); |
119 } | 119 } |
120 | 120 |
121 TEST_F(NetworkSessionConfiguratorTest, AltSvcFieldTrialEnabled) { | 121 TEST_F(NetworkSessionConfiguratorTest, AltSvcFieldTrialEnabled) { |
122 base::FieldTrialList::CreateFieldTrial("ParseAltSvc", "AltSvcEnabled"); | 122 base::FieldTrialList::CreateFieldTrial("ParseAltSvc", "AltSvcEnabled"); |
123 | 123 |
124 ParseFieldTrials(); | 124 ParseFieldTrials(); |
125 | 125 |
126 EXPECT_TRUE(params_.parse_alternative_services); | 126 EXPECT_TRUE(params_.parse_alternative_services); |
127 EXPECT_FALSE(params_.enable_alternative_service_with_different_host); | 127 EXPECT_TRUE(params_.enable_alternative_service_with_different_host); |
128 } | 128 } |
129 | 129 |
130 TEST_F(NetworkSessionConfiguratorTest, AltSvcFieldTrialDisabled) { | 130 TEST_F(NetworkSessionConfiguratorTest, AltSvcFieldTrialDisabled) { |
131 base::FieldTrialList::CreateFieldTrial("ParseAltSvc", "AltSvcDisabled"); | 131 base::FieldTrialList::CreateFieldTrial("ParseAltSvc", "AltSvcDisabled"); |
132 | 132 |
133 ParseFieldTrials(); | 133 ParseFieldTrials(); |
134 | 134 |
135 EXPECT_FALSE(params_.parse_alternative_services); | 135 EXPECT_FALSE(params_.parse_alternative_services); |
136 EXPECT_FALSE(params_.enable_alternative_service_with_different_host); | 136 EXPECT_TRUE(params_.enable_alternative_service_with_different_host); |
137 } | 137 } |
138 | 138 |
139 TEST_F(NetworkSessionConfiguratorTest, SpdyFieldTrialHoldbackEnabled) { | 139 TEST_F(NetworkSessionConfiguratorTest, SpdyFieldTrialHoldbackEnabled) { |
140 net::HttpStreamFactory::set_spdy_enabled(true); | 140 net::HttpStreamFactory::set_spdy_enabled(true); |
141 base::FieldTrialList::CreateFieldTrial("SPDY", "SpdyDisabled"); | 141 base::FieldTrialList::CreateFieldTrial("SPDY", "SpdyDisabled"); |
142 | 142 |
143 ParseFieldTrials(); | 143 ParseFieldTrials(); |
144 | 144 |
145 EXPECT_FALSE(net::HttpStreamFactory::spdy_enabled()); | 145 EXPECT_FALSE(net::HttpStreamFactory::spdy_enabled()); |
146 } | 146 } |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 EXPECT_EQ(1350u, params_.quic_max_packet_length); | 241 EXPECT_EQ(1350u, params_.quic_max_packet_length); |
242 EXPECT_EQ(net::QuicTagVector(), params_.quic_connection_options); | 242 EXPECT_EQ(net::QuicTagVector(), params_.quic_connection_options); |
243 EXPECT_FALSE(params_.quic_always_require_handshake_confirmation); | 243 EXPECT_FALSE(params_.quic_always_require_handshake_confirmation); |
244 EXPECT_FALSE(params_.quic_disable_connection_pooling); | 244 EXPECT_FALSE(params_.quic_disable_connection_pooling); |
245 EXPECT_EQ(0.25f, params_.quic_load_server_info_timeout_srtt_multiplier); | 245 EXPECT_EQ(0.25f, params_.quic_load_server_info_timeout_srtt_multiplier); |
246 EXPECT_FALSE(params_.quic_enable_connection_racing); | 246 EXPECT_FALSE(params_.quic_enable_connection_racing); |
247 EXPECT_FALSE(params_.quic_enable_non_blocking_io); | 247 EXPECT_FALSE(params_.quic_enable_non_blocking_io); |
248 EXPECT_FALSE(params_.quic_disable_disk_cache); | 248 EXPECT_FALSE(params_.quic_disable_disk_cache); |
249 EXPECT_FALSE(params_.quic_prefer_aes); | 249 EXPECT_FALSE(params_.quic_prefer_aes); |
250 EXPECT_TRUE(params_.parse_alternative_services); | 250 EXPECT_TRUE(params_.parse_alternative_services); |
251 EXPECT_FALSE(params_.enable_alternative_service_with_different_host); | 251 EXPECT_TRUE(params_.enable_alternative_service_with_different_host); |
252 EXPECT_EQ(0, params_.quic_max_number_of_lossy_connections); | 252 EXPECT_EQ(0, params_.quic_max_number_of_lossy_connections); |
253 EXPECT_EQ(1.0f, params_.quic_packet_loss_threshold); | 253 EXPECT_EQ(1.0f, params_.quic_packet_loss_threshold); |
254 EXPECT_TRUE(params_.quic_delay_tcp_race); | 254 EXPECT_TRUE(params_.quic_delay_tcp_race); |
255 EXPECT_FALSE(params_.quic_close_sessions_on_ip_change); | 255 EXPECT_FALSE(params_.quic_close_sessions_on_ip_change); |
256 EXPECT_EQ(net::kIdleConnectionTimeoutSeconds, | 256 EXPECT_EQ(net::kIdleConnectionTimeoutSeconds, |
257 params_.quic_idle_connection_timeout_seconds); | 257 params_.quic_idle_connection_timeout_seconds); |
258 EXPECT_FALSE(params_.quic_disable_preconnect_if_0rtt); | 258 EXPECT_FALSE(params_.quic_disable_preconnect_if_0rtt); |
259 EXPECT_FALSE(params_.quic_migrate_sessions_on_network_change); | 259 EXPECT_FALSE(params_.quic_migrate_sessions_on_network_change); |
260 EXPECT_FALSE(params_.quic_migrate_sessions_early); | 260 EXPECT_FALSE(params_.quic_migrate_sessions_early); |
261 EXPECT_TRUE(params_.quic_host_whitelist.empty()); | 261 EXPECT_TRUE(params_.quic_host_whitelist.empty()); |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, | 826 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, |
827 base::Unretained(this), "acc1")); | 827 base::Unretained(this), "acc1")); |
828 pref_service()->SetString(prefs::kAuthAndroidNegotiateAccountType, "acc2"); | 828 pref_service()->SetString(prefs::kAuthAndroidNegotiateAccountType, "acc2"); |
829 RunOnIOThreadBlocking(base::Bind( | 829 RunOnIOThreadBlocking(base::Bind( |
830 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, | 830 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, |
831 base::Unretained(this), "acc2")); | 831 base::Unretained(this), "acc2")); |
832 } | 832 } |
833 #endif | 833 #endif |
834 | 834 |
835 } // namespace test | 835 } // namespace test |
OLD | NEW |