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

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: Rebase. 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
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | components/domain_reliability/util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 EXPECT_FALSE(params.quic_disable_disk_cache); 227 EXPECT_FALSE(params.quic_disable_disk_cache);
228 EXPECT_FALSE(params.quic_prefer_aes); 228 EXPECT_FALSE(params.quic_prefer_aes);
229 EXPECT_FALSE(params.use_alternative_services); 229 EXPECT_FALSE(params.use_alternative_services);
230 EXPECT_EQ(0, params.quic_max_number_of_lossy_connections); 230 EXPECT_EQ(0, params.quic_max_number_of_lossy_connections);
231 EXPECT_EQ(1.0f, params.quic_packet_loss_threshold); 231 EXPECT_EQ(1.0f, params.quic_packet_loss_threshold);
232 EXPECT_FALSE(params.quic_delay_tcp_race); 232 EXPECT_FALSE(params.quic_delay_tcp_race);
233 EXPECT_FALSE(params.quic_close_sessions_on_ip_change); 233 EXPECT_FALSE(params.quic_close_sessions_on_ip_change);
234 EXPECT_EQ(net::kIdleConnectionTimeoutSeconds, 234 EXPECT_EQ(net::kIdleConnectionTimeoutSeconds,
235 params.quic_idle_connection_timeout_seconds); 235 params.quic_idle_connection_timeout_seconds);
236 EXPECT_FALSE(params.quic_disable_preconnect_if_0rtt); 236 EXPECT_FALSE(params.quic_disable_preconnect_if_0rtt);
237 EXPECT_FALSE(params.quic_migrate_sessions_on_network_change);
237 EXPECT_FALSE(IOThread::ShouldEnableQuicForDataReductionProxy()); 238 EXPECT_FALSE(IOThread::ShouldEnableQuicForDataReductionProxy());
238 EXPECT_TRUE(params.quic_host_whitelist.empty()); 239 EXPECT_TRUE(params.quic_host_whitelist.empty());
239 } 240 }
240 241
241 TEST_F(IOThreadTest, EnableQuicFromQuicProxyFieldTrialGroup) { 242 TEST_F(IOThreadTest, EnableQuicFromQuicProxyFieldTrialGroup) {
242 const struct { 243 const struct {
243 std::string field_trial_group_name; 244 std::string field_trial_group_name;
244 bool expect_enable_quic; 245 bool expect_enable_quic;
245 } tests[] = { 246 } tests[] = {
246 { 247 {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 343
343 TEST_F(IOThreadTest, QuicDisablePreConnectIfZeroRtt) { 344 TEST_F(IOThreadTest, QuicDisablePreConnectIfZeroRtt) {
344 field_trial_group_ = "Enabled"; 345 field_trial_group_ = "Enabled";
345 field_trial_params_["disable_preconnect_if_0rtt"] = "true"; 346 field_trial_params_["disable_preconnect_if_0rtt"] = "true";
346 ConfigureQuicGlobals(); 347 ConfigureQuicGlobals();
347 net::HttpNetworkSession::Params params; 348 net::HttpNetworkSession::Params params;
348 InitializeNetworkSessionParams(&params); 349 InitializeNetworkSessionParams(&params);
349 EXPECT_TRUE(params.quic_disable_preconnect_if_0rtt); 350 EXPECT_TRUE(params.quic_disable_preconnect_if_0rtt);
350 } 351 }
351 352
353 TEST_F(IOThreadTest, QuicMigrateSessionsOnNetworkChangeFromFieldTrialParams) {
354 field_trial_group_ = "Enabled";
355 field_trial_params_["migrate_sessions_on_network_change"] = "true";
356 ConfigureQuicGlobals();
357 net::HttpNetworkSession::Params params;
358 InitializeNetworkSessionParams(&params);
359 EXPECT_TRUE(params.quic_migrate_sessions_on_network_change);
360 }
361
352 TEST_F(IOThreadTest, PacketLengthFromFieldTrialParams) { 362 TEST_F(IOThreadTest, PacketLengthFromFieldTrialParams) {
353 field_trial_group_ = "Enabled"; 363 field_trial_group_ = "Enabled";
354 field_trial_params_["max_packet_length"] = "1450"; 364 field_trial_params_["max_packet_length"] = "1450";
355 365
356 ConfigureQuicGlobals(); 366 ConfigureQuicGlobals();
357 net::HttpNetworkSession::Params params; 367 net::HttpNetworkSession::Params params;
358 InitializeNetworkSessionParams(&params); 368 InitializeNetworkSessionParams(&params);
359 EXPECT_EQ(1450u, params.quic_max_packet_length); 369 EXPECT_EQ(1450u, params.quic_max_packet_length);
360 } 370 }
361 371
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, 795 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType,
786 base::Unretained(this), "acc1")); 796 base::Unretained(this), "acc1"));
787 pref_service()->SetString(prefs::kAuthAndroidNegotiateAccountType, "acc2"); 797 pref_service()->SetString(prefs::kAuthAndroidNegotiateAccountType, "acc2");
788 RunOnIOThreadBlocking(base::Bind( 798 RunOnIOThreadBlocking(base::Bind(
789 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, 799 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType,
790 base::Unretained(this), "acc2")); 800 base::Unretained(this), "acc2"));
791 } 801 }
792 #endif 802 #endif
793 803
794 } // namespace test 804 } // namespace test
OLDNEW
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | components/domain_reliability/util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698