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

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

Issue 1327923002: Migrates QUIC sessions to a new network when old network is (about to be) disconnected. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@home
Patch Set: Addresses rch's comments. 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 "base/at_exit.h" 5 #include "base/at_exit.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/metrics/field_trial.h" 7 #include "base/metrics/field_trial.h"
8 #include "base/prefs/pref_registry_simple.h" 8 #include "base/prefs/pref_registry_simple.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/prefs/testing_pref_service.h" 10 #include "base/prefs/testing_pref_service.h"
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 EXPECT_FALSE(params.quic_disable_disk_cache); 226 EXPECT_FALSE(params.quic_disable_disk_cache);
227 EXPECT_FALSE(params.quic_prefer_aes); 227 EXPECT_FALSE(params.quic_prefer_aes);
228 EXPECT_FALSE(params.use_alternative_services); 228 EXPECT_FALSE(params.use_alternative_services);
229 EXPECT_EQ(0, params.quic_max_number_of_lossy_connections); 229 EXPECT_EQ(0, params.quic_max_number_of_lossy_connections);
230 EXPECT_EQ(1.0f, params.quic_packet_loss_threshold); 230 EXPECT_EQ(1.0f, params.quic_packet_loss_threshold);
231 EXPECT_FALSE(params.quic_delay_tcp_race); 231 EXPECT_FALSE(params.quic_delay_tcp_race);
232 EXPECT_FALSE(params.quic_close_sessions_on_ip_change); 232 EXPECT_FALSE(params.quic_close_sessions_on_ip_change);
233 EXPECT_EQ(net::kIdleConnectionTimeoutSeconds, 233 EXPECT_EQ(net::kIdleConnectionTimeoutSeconds,
234 params.quic_idle_connection_timeout_seconds); 234 params.quic_idle_connection_timeout_seconds);
235 EXPECT_FALSE(params.quic_disable_preconnect_if_0rtt); 235 EXPECT_FALSE(params.quic_disable_preconnect_if_0rtt);
236 EXPECT_FALSE(params.quic_migrate_sessions_on_net_change);
236 EXPECT_FALSE(IOThread::ShouldEnableQuicForDataReductionProxy()); 237 EXPECT_FALSE(IOThread::ShouldEnableQuicForDataReductionProxy());
237 } 238 }
238 239
239 TEST_F(IOThreadTest, EnableQuicFromQuicProxyFieldTrialGroup) { 240 TEST_F(IOThreadTest, EnableQuicFromQuicProxyFieldTrialGroup) {
240 const struct { 241 const struct {
241 std::string field_trial_group_name; 242 std::string field_trial_group_name;
242 bool expect_enable_quic; 243 bool expect_enable_quic;
243 } tests[] = { 244 } tests[] = {
244 { 245 {
245 std::string(), false, 246 std::string(), false,
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 341
341 TEST_F(IOThreadTest, QuicDisablePreConnectIfZeroRtt) { 342 TEST_F(IOThreadTest, QuicDisablePreConnectIfZeroRtt) {
342 field_trial_group_ = "Enabled"; 343 field_trial_group_ = "Enabled";
343 field_trial_params_["disable_preconnect_if_0rtt"] = "true"; 344 field_trial_params_["disable_preconnect_if_0rtt"] = "true";
344 ConfigureQuicGlobals(); 345 ConfigureQuicGlobals();
345 net::HttpNetworkSession::Params params; 346 net::HttpNetworkSession::Params params;
346 InitializeNetworkSessionParams(&params); 347 InitializeNetworkSessionParams(&params);
347 EXPECT_TRUE(params.quic_disable_preconnect_if_0rtt); 348 EXPECT_TRUE(params.quic_disable_preconnect_if_0rtt);
348 } 349 }
349 350
351 TEST_F(IOThreadTest, QuicMigrateSessionsOnNetworkChangeFromFieldTrialParams) {
352 field_trial_group_ = "Enabled";
353 field_trial_params_["migrate_sessions_on_network_change"] = "true";
354 ConfigureQuicGlobals();
355 net::HttpNetworkSession::Params params;
356 InitializeNetworkSessionParams(&params);
357 EXPECT_TRUE(params.quic_migrate_sessions_on_network_change);
358
350 TEST_F(IOThreadTest, PacketLengthFromFieldTrialParams) { 359 TEST_F(IOThreadTest, PacketLengthFromFieldTrialParams) {
351 field_trial_group_ = "Enabled"; 360 field_trial_group_ = "Enabled";
352 field_trial_params_["max_packet_length"] = "1450"; 361 field_trial_params_["max_packet_length"] = "1450";
353 362
354 ConfigureQuicGlobals(); 363 ConfigureQuicGlobals();
355 net::HttpNetworkSession::Params params; 364 net::HttpNetworkSession::Params params;
356 InitializeNetworkSessionParams(&params); 365 InitializeNetworkSessionParams(&params);
357 EXPECT_EQ(1450u, params.quic_max_packet_length); 366 EXPECT_EQ(1450u, params.quic_max_packet_length);
358 } 367 }
359 368
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, 753 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType,
745 base::Unretained(this), "acc1")); 754 base::Unretained(this), "acc1"));
746 pref_service()->SetString(prefs::kAuthAndroidNegotiateAccountType, "acc2"); 755 pref_service()->SetString(prefs::kAuthAndroidNegotiateAccountType, "acc2");
747 RunOnIOThreadBlocking(base::Bind( 756 RunOnIOThreadBlocking(base::Bind(
748 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, 757 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType,
749 base::Unretained(this), "acc2")); 758 base::Unretained(this), "acc2"));
750 } 759 }
751 #endif 760 #endif
752 761
753 } // namespace test 762 } // namespace test
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698