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

Side by Side Diff: chrome/browser/io_thread_unittest.cc

Issue 1603203002: Add a finch trial param to disable QUIC when connection times out with open streams (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months 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 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 } 206 }
207 207
208 TEST_F(IOThreadTest, EnableQuicFromFieldTrialGroup) { 208 TEST_F(IOThreadTest, EnableQuicFromFieldTrialGroup) {
209 field_trial_group_ = "Enabled"; 209 field_trial_group_ = "Enabled";
210 210
211 ConfigureQuicGlobals(); 211 ConfigureQuicGlobals();
212 net::HttpNetworkSession::Params default_params; 212 net::HttpNetworkSession::Params default_params;
213 net::HttpNetworkSession::Params params; 213 net::HttpNetworkSession::Params params;
214 InitializeNetworkSessionParams(&params); 214 InitializeNetworkSessionParams(&params);
215 EXPECT_TRUE(params.enable_quic); 215 EXPECT_TRUE(params.enable_quic);
216 EXPECT_FALSE(params.disable_quic_when_connection_times_out_with_open_streams);
216 EXPECT_TRUE(params.enable_quic_for_proxies); 217 EXPECT_TRUE(params.enable_quic_for_proxies);
217 EXPECT_EQ(1350u, params.quic_max_packet_length); 218 EXPECT_EQ(1350u, params.quic_max_packet_length);
218 EXPECT_EQ(1.0, params.alternative_service_probability_threshold); 219 EXPECT_EQ(1.0, params.alternative_service_probability_threshold);
219 EXPECT_EQ(default_params.quic_supported_versions, 220 EXPECT_EQ(default_params.quic_supported_versions,
220 params.quic_supported_versions); 221 params.quic_supported_versions);
221 EXPECT_EQ(net::QuicTagVector(), params.quic_connection_options); 222 EXPECT_EQ(net::QuicTagVector(), params.quic_connection_options);
222 EXPECT_FALSE(params.quic_always_require_handshake_confirmation); 223 EXPECT_FALSE(params.quic_always_require_handshake_confirmation);
223 EXPECT_FALSE(params.quic_disable_connection_pooling); 224 EXPECT_FALSE(params.quic_disable_connection_pooling);
224 EXPECT_EQ(0.25f, params.quic_load_server_info_timeout_srtt_multiplier); 225 EXPECT_EQ(0.25f, params.quic_load_server_info_timeout_srtt_multiplier);
225 EXPECT_FALSE(params.quic_enable_connection_racing); 226 EXPECT_FALSE(params.quic_enable_connection_racing);
226 EXPECT_FALSE(params.quic_enable_non_blocking_io); 227 EXPECT_FALSE(params.quic_enable_non_blocking_io);
227 EXPECT_FALSE(params.quic_disable_disk_cache); 228 EXPECT_FALSE(params.quic_disable_disk_cache);
228 EXPECT_FALSE(params.quic_prefer_aes); 229 EXPECT_FALSE(params.quic_prefer_aes);
229 EXPECT_FALSE(params.use_alternative_services); 230 EXPECT_FALSE(params.use_alternative_services);
230 EXPECT_EQ(0, params.quic_max_number_of_lossy_connections); 231 EXPECT_EQ(0, params.quic_max_number_of_lossy_connections);
231 EXPECT_EQ(1.0f, params.quic_packet_loss_threshold); 232 EXPECT_EQ(1.0f, params.quic_packet_loss_threshold);
232 EXPECT_FALSE(params.quic_delay_tcp_race); 233 EXPECT_FALSE(params.quic_delay_tcp_race);
233 EXPECT_FALSE(params.quic_close_sessions_on_ip_change); 234 EXPECT_FALSE(params.quic_close_sessions_on_ip_change);
234 EXPECT_EQ(net::kIdleConnectionTimeoutSeconds, 235 EXPECT_EQ(net::kIdleConnectionTimeoutSeconds,
235 params.quic_idle_connection_timeout_seconds); 236 params.quic_idle_connection_timeout_seconds);
236 EXPECT_FALSE(params.quic_disable_preconnect_if_0rtt); 237 EXPECT_FALSE(params.quic_disable_preconnect_if_0rtt);
237 EXPECT_FALSE(params.quic_migrate_sessions_on_network_change); 238 EXPECT_FALSE(params.quic_migrate_sessions_on_network_change);
238 EXPECT_FALSE(IOThread::ShouldEnableQuicForDataReductionProxy()); 239 EXPECT_FALSE(IOThread::ShouldEnableQuicForDataReductionProxy());
239 EXPECT_TRUE(params.quic_host_whitelist.empty()); 240 EXPECT_TRUE(params.quic_host_whitelist.empty());
240 } 241 }
241 242
243 TEST_F(IOThreadTest,
244 DisableQuicWhenConnectionTimesOutWithOpenStreamsFromFieldTrialParams) {
245 field_trial_group_ = "Enabled";
246 field_trial_params_["disable_quic_when_connection_times_out_with_open_streams" ]
247 = "true";
248 ConfigureQuicGlobals();
249 net::HttpNetworkSession::Params params;
250 InitializeNetworkSessionParams(&params);
251 EXPECT_TRUE(params.disable_quic_when_connection_times_out_with_open_streams);
252 }
253
242 TEST_F(IOThreadTest, EnableQuicFromQuicProxyFieldTrialGroup) { 254 TEST_F(IOThreadTest, EnableQuicFromQuicProxyFieldTrialGroup) {
243 const struct { 255 const struct {
244 std::string field_trial_group_name; 256 std::string field_trial_group_name;
245 bool expect_enable_quic; 257 bool expect_enable_quic;
246 } tests[] = { 258 } tests[] = {
247 { 259 {
248 std::string(), false, 260 std::string(), false,
249 }, 261 },
250 { 262 {
251 "NotEnabled", false, 263 "NotEnabled", false,
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, 807 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType,
796 base::Unretained(this), "acc1")); 808 base::Unretained(this), "acc1"));
797 pref_service()->SetString(prefs::kAuthAndroidNegotiateAccountType, "acc2"); 809 pref_service()->SetString(prefs::kAuthAndroidNegotiateAccountType, "acc2");
798 RunOnIOThreadBlocking(base::Bind( 810 RunOnIOThreadBlocking(base::Bind(
799 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, 811 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType,
800 base::Unretained(this), "acc2")); 812 base::Unretained(this), "acc2"));
801 } 813 }
802 #endif 814 #endif
803 815
804 } // namespace test 816 } // namespace test
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698