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

Side by Side Diff: net/tools/quic/end_to_end_test.cc

Issue 2308043003: Landing Recent QUIC changes until 5:55 PM, Aug 25, 2016 UTC-4 (Closed)
Patch Set: Fixes for various tests Created 4 years, 3 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 | « net/quic/test_tools/quic_test_utils.h ('k') | net/tools/quic/quic_dispatcher.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include <sys/epoll.h> 6 #include <sys/epoll.h>
7 7
8 #include <list> 8 #include <list>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 client_versions.front(), 252 client_versions.front(),
253 client_supports_stateless_rejects, 253 client_supports_stateless_rejects,
254 server_uses_stateless_rejects_if_peer_supported, 254 server_uses_stateless_rejects_if_peer_supported,
255 congestion_control_tag, disable_hpack_dynamic_table, 255 congestion_control_tag, disable_hpack_dynamic_table,
256 force_hol_blocking, use_cheap_stateless_reject, 256 force_hol_blocking, use_cheap_stateless_reject,
257 buffer_packet_till_chlo, small_client_mtu)); 257 buffer_packet_till_chlo, small_client_mtu));
258 258
259 // Run version negotiation tests tests with no options, or 259 // Run version negotiation tests tests with no options, or
260 // all the options enabled to avoid a combinatorial 260 // all the options enabled to avoid a combinatorial
261 // explosion. 261 // explosion.
262 if (enabled_options > 0 && 262 if (enabled_options > 1 &&
263 enabled_options < kMaxEnabledOptions) { 263 enabled_options < kMaxEnabledOptions) {
264 continue; 264 continue;
265 } 265 }
266 266
267 // Test client supporting all versions and server supporting 267 // Test client supporting all versions and server supporting
268 // 1 version. Simulate an old server and exercise version 268 // 1 version. Simulate an old server and exercise version
269 // downgrade in the client. Protocol negotiation should 269 // downgrade in the client. Protocol negotiation should
270 // occur. Skip the i = 0 case because it is essentially the 270 // occur. Skip the i = 0 case because it is essentially the
271 // same as the default case. 271 // same as the default case.
272 for (size_t i = 1; i < client_versions.size(); ++i) { 272 for (size_t i = 1; i < client_versions.size(); ++i) {
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 void TearDown() override { 491 void TearDown() override {
492 ASSERT_TRUE(initialized_) << "You must call Initialize() in every test " 492 ASSERT_TRUE(initialized_) << "You must call Initialize() in every test "
493 << "case. Otherwise, your test will leak memory."; 493 << "case. Otherwise, your test will leak memory.";
494 StopServer(); 494 StopServer();
495 } 495 }
496 496
497 void StartServer() { 497 void StartServer() {
498 FLAGS_quic_buffer_packet_till_chlo = GetParam().buffer_packet_till_chlo; 498 FLAGS_quic_buffer_packet_till_chlo = GetParam().buffer_packet_till_chlo;
499 FLAGS_quic_use_cheap_stateless_rejects = 499 FLAGS_quic_use_cheap_stateless_rejects =
500 GetParam().use_cheap_stateless_reject; 500 GetParam().use_cheap_stateless_reject;
501 if (!FLAGS_quic_buffer_packet_till_chlo) {
502 FLAGS_quic_limit_num_new_sessions_per_epoll_loop = false;
503 }
501 auto test_server = 504 auto test_server =
502 new QuicTestServer(CryptoTestUtils::ProofSourceForTesting(), 505 new QuicTestServer(CryptoTestUtils::ProofSourceForTesting(),
503 server_config_, server_supported_versions_); 506 server_config_, server_supported_versions_);
504 if (GetParam().small_client_mtu) { 507 if (GetParam().small_client_mtu) {
505 FLAGS_quic_enforce_mtu_limit = true; 508 FLAGS_quic_enforce_mtu_limit = true;
506 QuicServerPeer::SetReader(test_server, new SmallMtuPacketReader); 509 QuicServerPeer::SetReader(test_server, new SmallMtuPacketReader);
507 server_writer_->set_max_allowed_packet_size(kMinimumSupportedPacketSize); 510 server_writer_->set_max_allowed_packet_size(kMinimumSupportedPacketSize);
508 } 511 }
509 server_thread_.reset(new ServerThread(test_server, server_address_, 512 server_thread_.reset(new ServerThread(test_server, server_address_,
510 strike_register_no_startup_period_)); 513 strike_register_no_startup_period_));
(...skipping 2406 matching lines...) Expand 10 before | Expand all | Expand 10 after
2917 EXPECT_EQ(kBarResponseBody, client_->response_body()); 2920 EXPECT_EQ(kBarResponseBody, client_->response_body());
2918 QuicConnectionStats client_stats = 2921 QuicConnectionStats client_stats =
2919 client_->client()->session()->connection()->GetStats(); 2922 client_->client()->session()->connection()->GetStats();
2920 EXPECT_EQ(0u, client_stats.packets_lost); 2923 EXPECT_EQ(0u, client_stats.packets_lost);
2921 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos()); 2924 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos());
2922 } 2925 }
2923 2926
2924 } // namespace 2927 } // namespace
2925 } // namespace test 2928 } // namespace test
2926 } // namespace net 2929 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/quic_test_utils.h ('k') | net/tools/quic/quic_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698