| OLD | NEW |
| 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 <cstdint> | 8 #include <cstdint> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 version_buckets[0].push_back(version); | 159 version_buckets[0].push_back(version); |
| 160 } | 160 } |
| 161 | 161 |
| 162 // This must be kept in sync with the number of nested for-loops below as it | 162 // This must be kept in sync with the number of nested for-loops below as it |
| 163 // is used to prune the number of tests that are run. | 163 // is used to prune the number of tests that are run. |
| 164 const int kMaxEnabledOptions = 7; | 164 const int kMaxEnabledOptions = 7; |
| 165 int max_enabled_options = 0; | 165 int max_enabled_options = 0; |
| 166 std::vector<TestParams> params; | 166 std::vector<TestParams> params; |
| 167 for (bool server_uses_stateless_rejects_if_peer_supported : {true, false}) { | 167 for (bool server_uses_stateless_rejects_if_peer_supported : {true, false}) { |
| 168 for (bool client_supports_stateless_rejects : {true, false}) { | 168 for (bool client_supports_stateless_rejects : {true, false}) { |
| 169 for (const QuicTag congestion_control_tag : {kRENO, kTBBR, kQBIC}) { | 169 for (const QuicTag congestion_control_tag : |
| 170 {kRENO, kTBBR, kQBIC, kTPCC}) { |
| 170 for (bool disable_hpack_dynamic_table : {false}) { | 171 for (bool disable_hpack_dynamic_table : {false}) { |
| 171 for (bool force_hol_blocking : {true, false}) { | 172 for (bool force_hol_blocking : {true, false}) { |
| 172 for (bool use_cheap_stateless_reject : {true, false}) { | 173 for (bool use_cheap_stateless_reject : {true, false}) { |
| 173 for (bool connection_id_big_endian_client : {true, false}) { | 174 for (bool connection_id_big_endian_client : {true, false}) { |
| 174 for (bool connection_id_big_endian_server : {true, false}) { | 175 for (bool connection_id_big_endian_server : {true, false}) { |
| 175 int enabled_options = 0; | 176 int enabled_options = 0; |
| 176 if (force_hol_blocking) { | 177 if (force_hol_blocking) { |
| 177 ++enabled_options; | 178 ++enabled_options; |
| 178 } | 179 } |
| 179 if (congestion_control_tag != kQBIC) { | 180 if (congestion_control_tag != kQBIC) { |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 copt.push_back(kCCVX); | 419 copt.push_back(kCCVX); |
| 419 } | 420 } |
| 420 if (GetParam().congestion_control_tag == kQBIC && | 421 if (GetParam().congestion_control_tag == kQBIC && |
| 421 FLAGS_quic_reloadable_flag_quic_fix_cubic_bytes_quantization) { | 422 FLAGS_quic_reloadable_flag_quic_fix_cubic_bytes_quantization) { |
| 422 copt.push_back(kCBQT); | 423 copt.push_back(kCBQT); |
| 423 } | 424 } |
| 424 if (GetParam().congestion_control_tag == kQBIC && | 425 if (GetParam().congestion_control_tag == kQBIC && |
| 425 FLAGS_quic_reloadable_flag_quic_enable_cubic_per_ack_updates) { | 426 FLAGS_quic_reloadable_flag_quic_enable_cubic_per_ack_updates) { |
| 426 copt.push_back(kCPAU); | 427 copt.push_back(kCPAU); |
| 427 } | 428 } |
| 429 if (GetParam().congestion_control_tag == kTPCC && |
| 430 FLAGS_quic_reloadable_flag_quic_enable_pcc) { |
| 431 copt.push_back(kTPCC); |
| 432 } |
| 428 | 433 |
| 429 if (support_server_push_) { | 434 if (support_server_push_) { |
| 430 copt.push_back(kSPSH); | 435 copt.push_back(kSPSH); |
| 431 } | 436 } |
| 432 if (GetParam().client_supports_stateless_rejects) { | 437 if (GetParam().client_supports_stateless_rejects) { |
| 433 copt.push_back(kSREJ); | 438 copt.push_back(kSREJ); |
| 434 } | 439 } |
| 435 if (GetParam().disable_hpack_dynamic_table) { | 440 if (GetParam().disable_hpack_dynamic_table) { |
| 436 copt.push_back(kDHDT); | 441 copt.push_back(kDHDT); |
| 437 } | 442 } |
| (...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1341 QuicServerPeer::GetDispatcher(server_thread_->server()); | 1346 QuicServerPeer::GetDispatcher(server_thread_->server()); |
| 1342 QuicSession* server_session = dispatcher->session_map().begin()->second.get(); | 1347 QuicSession* server_session = dispatcher->session_map().begin()->second.get(); |
| 1343 EXPECT_EQ(kClientMaxIncomingDynamicStreams, | 1348 EXPECT_EQ(kClientMaxIncomingDynamicStreams, |
| 1344 server_session->max_open_outgoing_streams()); | 1349 server_session->max_open_outgoing_streams()); |
| 1345 server_thread_->Resume(); | 1350 server_thread_->Resume(); |
| 1346 } | 1351 } |
| 1347 | 1352 |
| 1348 TEST_P(EndToEndTest, NegotiateCongestionControl) { | 1353 TEST_P(EndToEndTest, NegotiateCongestionControl) { |
| 1349 FLAGS_quic_reloadable_flag_quic_allow_new_bbr = true; | 1354 FLAGS_quic_reloadable_flag_quic_allow_new_bbr = true; |
| 1350 ASSERT_TRUE(Initialize()); | 1355 ASSERT_TRUE(Initialize()); |
| 1356 |
| 1357 // For PCC, the underlying implementation may be a stub with a |
| 1358 // different name-tag. Skip the rest of this test. |
| 1359 if (GetParam().congestion_control_tag == kTPCC) { |
| 1360 return; |
| 1361 } |
| 1362 |
| 1351 EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed()); | 1363 EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed()); |
| 1352 | 1364 |
| 1353 CongestionControlType expected_congestion_control_type = kReno; | 1365 CongestionControlType expected_congestion_control_type = kReno; |
| 1354 switch (GetParam().congestion_control_tag) { | 1366 switch (GetParam().congestion_control_tag) { |
| 1355 case kRENO: | 1367 case kRENO: |
| 1356 expected_congestion_control_type = kReno; | 1368 expected_congestion_control_type = kReno; |
| 1357 break; | 1369 break; |
| 1358 case kTBBR: | 1370 case kTBBR: |
| 1359 expected_congestion_control_type = kBBR; | 1371 expected_congestion_control_type = kBBR; |
| 1360 break; | 1372 break; |
| (...skipping 1762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3123 client_->WaitForResponse(); | 3135 client_->WaitForResponse(); |
| 3124 EXPECT_EQ(kBarResponseBody, client_->response_body()); | 3136 EXPECT_EQ(kBarResponseBody, client_->response_body()); |
| 3125 QuicConnectionStats client_stats = | 3137 QuicConnectionStats client_stats = |
| 3126 client_->client()->session()->connection()->GetStats(); | 3138 client_->client()->session()->connection()->GetStats(); |
| 3127 EXPECT_EQ(0u, client_stats.packets_lost); | 3139 EXPECT_EQ(0u, client_stats.packets_lost); |
| 3128 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos()); | 3140 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos()); |
| 3129 } | 3141 } |
| 3130 } // namespace | 3142 } // namespace |
| 3131 } // namespace test | 3143 } // namespace test |
| 3132 } // namespace net | 3144 } // namespace net |
| OLD | NEW |