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

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: Added read/write socket error tests. 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 EXPECT_FALSE(params.quic_disable_disk_cache); 230 EXPECT_FALSE(params.quic_disable_disk_cache);
231 EXPECT_FALSE(params.quic_prefer_aes); 231 EXPECT_FALSE(params.quic_prefer_aes);
232 EXPECT_FALSE(params.use_alternative_services); 232 EXPECT_FALSE(params.use_alternative_services);
233 EXPECT_EQ(0, params.quic_max_number_of_lossy_connections); 233 EXPECT_EQ(0, params.quic_max_number_of_lossy_connections);
234 EXPECT_EQ(1.0f, params.quic_packet_loss_threshold); 234 EXPECT_EQ(1.0f, params.quic_packet_loss_threshold);
235 EXPECT_FALSE(params.quic_delay_tcp_race); 235 EXPECT_FALSE(params.quic_delay_tcp_race);
236 EXPECT_FALSE(params.quic_close_sessions_on_ip_change); 236 EXPECT_FALSE(params.quic_close_sessions_on_ip_change);
237 EXPECT_EQ(net::kIdleConnectionTimeoutSeconds, 237 EXPECT_EQ(net::kIdleConnectionTimeoutSeconds,
238 params.quic_idle_connection_timeout_seconds); 238 params.quic_idle_connection_timeout_seconds);
239 EXPECT_FALSE(params.quic_disable_preconnect_if_0rtt); 239 EXPECT_FALSE(params.quic_disable_preconnect_if_0rtt);
240 EXPECT_FALSE(params.quic_migrate_sessions_on_net_change);
240 EXPECT_FALSE(IOThread::ShouldEnableQuicForDataReductionProxy()); 241 EXPECT_FALSE(IOThread::ShouldEnableQuicForDataReductionProxy());
241 } 242 }
242 243
243 TEST_F(IOThreadTest, EnableQuicFromQuicProxyFieldTrialGroup) { 244 TEST_F(IOThreadTest, EnableQuicFromQuicProxyFieldTrialGroup) {
244 const struct { 245 const struct {
245 std::string field_trial_group_name; 246 std::string field_trial_group_name;
246 bool expect_enable_quic; 247 bool expect_enable_quic;
247 } tests[] = { 248 } tests[] = {
248 { 249 {
249 std::string(), false, 250 std::string(), false,
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 345
345 TEST_F(IOThreadTest, QuicDisablePreConnectIfZeroRtt) { 346 TEST_F(IOThreadTest, QuicDisablePreConnectIfZeroRtt) {
346 field_trial_group_ = "Enabled"; 347 field_trial_group_ = "Enabled";
347 field_trial_params_["disable_preconnect_if_0rtt"] = "true"; 348 field_trial_params_["disable_preconnect_if_0rtt"] = "true";
348 ConfigureQuicGlobals(); 349 ConfigureQuicGlobals();
349 net::HttpNetworkSession::Params params; 350 net::HttpNetworkSession::Params params;
350 InitializeNetworkSessionParams(&params); 351 InitializeNetworkSessionParams(&params);
351 EXPECT_TRUE(params.quic_disable_preconnect_if_0rtt); 352 EXPECT_TRUE(params.quic_disable_preconnect_if_0rtt);
352 } 353 }
353 354
355 TEST_F(IOThreadTest, QuicMigrateSessionsOnNetworkChangeFromFieldTrialParams) {
356 field_trial_group_ = "Enabled";
357 field_trial_params_["migrate_sessions_on_network_change"] = "true";
358 ConfigureQuicGlobals();
359 net::HttpNetworkSession::Params params;
360 InitializeNetworkSessionParams(&params);
361 EXPECT_TRUE(params.quic_migrate_sessions_on_network_change);
362
354 TEST_F(IOThreadTest, PacketLengthFromFieldTrialParams) { 363 TEST_F(IOThreadTest, PacketLengthFromFieldTrialParams) {
355 field_trial_group_ = "Enabled"; 364 field_trial_group_ = "Enabled";
356 field_trial_params_["max_packet_length"] = "1450"; 365 field_trial_params_["max_packet_length"] = "1450";
357 366
358 ConfigureQuicGlobals(); 367 ConfigureQuicGlobals();
359 net::HttpNetworkSession::Params params; 368 net::HttpNetworkSession::Params params;
360 InitializeNetworkSessionParams(&params); 369 InitializeNetworkSessionParams(&params);
361 EXPECT_EQ(1450u, params.quic_max_packet_length); 370 EXPECT_EQ(1450u, params.quic_max_packet_length);
362 } 371 }
363 372
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, 764 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType,
756 base::Unretained(this), "acc1")); 765 base::Unretained(this), "acc1"));
757 pref_service()->SetString(prefs::kAuthAndroidNegotiateAccountType, "acc2"); 766 pref_service()->SetString(prefs::kAuthAndroidNegotiateAccountType, "acc2");
758 RunOnIOThreadBlocking(base::Bind( 767 RunOnIOThreadBlocking(base::Bind(
759 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, 768 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType,
760 base::Unretained(this), "acc2")); 769 base::Unretained(this), "acc2"));
761 } 770 }
762 #endif 771 #endif
763 772
764 } // namespace test 773 } // namespace test
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698