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

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

Issue 1613513003: Early connection migration in QUIC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@home
Patch Set: Style nit fixed. Created 4 years, 10 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 EXPECT_FALSE(params.parse_alternative_services); 241 EXPECT_FALSE(params.parse_alternative_services);
242 EXPECT_FALSE(params.enable_alternative_service_with_different_host); 242 EXPECT_FALSE(params.enable_alternative_service_with_different_host);
243 EXPECT_EQ(0, params.quic_max_number_of_lossy_connections); 243 EXPECT_EQ(0, params.quic_max_number_of_lossy_connections);
244 EXPECT_EQ(1.0f, params.quic_packet_loss_threshold); 244 EXPECT_EQ(1.0f, params.quic_packet_loss_threshold);
245 EXPECT_FALSE(params.quic_delay_tcp_race); 245 EXPECT_FALSE(params.quic_delay_tcp_race);
246 EXPECT_FALSE(params.quic_close_sessions_on_ip_change); 246 EXPECT_FALSE(params.quic_close_sessions_on_ip_change);
247 EXPECT_EQ(net::kIdleConnectionTimeoutSeconds, 247 EXPECT_EQ(net::kIdleConnectionTimeoutSeconds,
248 params.quic_idle_connection_timeout_seconds); 248 params.quic_idle_connection_timeout_seconds);
249 EXPECT_FALSE(params.quic_disable_preconnect_if_0rtt); 249 EXPECT_FALSE(params.quic_disable_preconnect_if_0rtt);
250 EXPECT_FALSE(params.quic_migrate_sessions_on_network_change); 250 EXPECT_FALSE(params.quic_migrate_sessions_on_network_change);
251 EXPECT_FALSE(params.quic_migrate_sessions_early);
251 EXPECT_FALSE(IOThread::ShouldEnableQuicForDataReductionProxy()); 252 EXPECT_FALSE(IOThread::ShouldEnableQuicForDataReductionProxy());
252 EXPECT_TRUE(params.quic_host_whitelist.empty()); 253 EXPECT_TRUE(params.quic_host_whitelist.empty());
253 } 254 }
254 255
255 TEST_F(IOThreadTest, 256 TEST_F(IOThreadTest,
256 DisableQuicWhenConnectionTimesOutWithOpenStreamsFromFieldTrialParams) { 257 DisableQuicWhenConnectionTimesOutWithOpenStreamsFromFieldTrialParams) {
257 field_trial_group_ = "Enabled"; 258 field_trial_group_ = "Enabled";
258 field_trial_params_["disable_quic_on_timeout_with_open_streams"] = "true"; 259 field_trial_params_["disable_quic_on_timeout_with_open_streams"] = "true";
259 ConfigureQuicGlobals(); 260 ConfigureQuicGlobals();
260 net::HttpNetworkSession::Params params; 261 net::HttpNetworkSession::Params params;
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 398
398 TEST_F(IOThreadTest, QuicMigrateSessionsOnNetworkChangeFromFieldTrialParams) { 399 TEST_F(IOThreadTest, QuicMigrateSessionsOnNetworkChangeFromFieldTrialParams) {
399 field_trial_group_ = "Enabled"; 400 field_trial_group_ = "Enabled";
400 field_trial_params_["migrate_sessions_on_network_change"] = "true"; 401 field_trial_params_["migrate_sessions_on_network_change"] = "true";
401 ConfigureQuicGlobals(); 402 ConfigureQuicGlobals();
402 net::HttpNetworkSession::Params params; 403 net::HttpNetworkSession::Params params;
403 InitializeNetworkSessionParams(&params); 404 InitializeNetworkSessionParams(&params);
404 EXPECT_TRUE(params.quic_migrate_sessions_on_network_change); 405 EXPECT_TRUE(params.quic_migrate_sessions_on_network_change);
405 } 406 }
406 407
408 TEST_F(IOThreadTest, QuicMigrateSessionsEarlyFromFieldTrialParams) {
409 field_trial_group_ = "Enabled";
410 field_trial_params_["migrate_sessions_early"] = "true";
411 ConfigureQuicGlobals();
412 net::HttpNetworkSession::Params params;
413 InitializeNetworkSessionParams(&params);
414 EXPECT_TRUE(params.quic_migrate_sessions_early);
415 }
416
407 TEST_F(IOThreadTest, PacketLengthFromFieldTrialParams) { 417 TEST_F(IOThreadTest, PacketLengthFromFieldTrialParams) {
408 field_trial_group_ = "Enabled"; 418 field_trial_group_ = "Enabled";
409 field_trial_params_["max_packet_length"] = "1450"; 419 field_trial_params_["max_packet_length"] = "1450";
410 420
411 ConfigureQuicGlobals(); 421 ConfigureQuicGlobals();
412 net::HttpNetworkSession::Params params; 422 net::HttpNetworkSession::Params params;
413 InitializeNetworkSessionParams(&params); 423 InitializeNetworkSessionParams(&params);
414 EXPECT_EQ(1450u, params.quic_max_packet_length); 424 EXPECT_EQ(1450u, params.quic_max_packet_length);
415 } 425 }
416 426
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, 851 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType,
842 base::Unretained(this), "acc1")); 852 base::Unretained(this), "acc1"));
843 pref_service()->SetString(prefs::kAuthAndroidNegotiateAccountType, "acc2"); 853 pref_service()->SetString(prefs::kAuthAndroidNegotiateAccountType, "acc2");
844 RunOnIOThreadBlocking(base::Bind( 854 RunOnIOThreadBlocking(base::Bind(
845 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, 855 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType,
846 base::Unretained(this), "acc2")); 856 base::Unretained(this), "acc2"));
847 } 857 }
848 #endif 858 #endif
849 859
850 } // namespace test 860 } // namespace test
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698