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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 } | 377 } |
378 | 378 |
379 bool Initialize() { | 379 bool Initialize() { |
380 QuicTagVector copt; | 380 QuicTagVector copt; |
381 server_config_.SetConnectionOptionsToSend(copt); | 381 server_config_.SetConnectionOptionsToSend(copt); |
382 copt = client_extra_copts_; | 382 copt = client_extra_copts_; |
383 | 383 |
384 // TODO(nimia): Consider setting the congestion control algorithm for the | 384 // TODO(nimia): Consider setting the congestion control algorithm for the |
385 // client as well according to the test parameter. | 385 // client as well according to the test parameter. |
386 copt.push_back(GetParam().congestion_control_tag); | 386 copt.push_back(GetParam().congestion_control_tag); |
387 if (GetParam().congestion_control_tag == kQBIC && | 387 if (GetParam().congestion_control_tag == kQBIC) { |
388 FLAGS_quic_reloadable_flag_quic_fix_cubic_convex_mode) { | |
389 copt.push_back(kCCVX); | 388 copt.push_back(kCCVX); |
390 } | 389 } |
391 if (GetParam().congestion_control_tag == kQBIC && | 390 if (GetParam().congestion_control_tag == kQBIC) { |
392 FLAGS_quic_reloadable_flag_quic_fix_cubic_bytes_quantization) { | |
393 copt.push_back(kCBQT); | 391 copt.push_back(kCBQT); |
394 } | 392 } |
395 if (GetParam().congestion_control_tag == kQBIC && | 393 if (GetParam().congestion_control_tag == kQBIC) { |
396 FLAGS_quic_reloadable_flag_quic_enable_cubic_per_ack_updates) { | |
397 copt.push_back(kCPAU); | 394 copt.push_back(kCPAU); |
398 } | 395 } |
399 if (GetParam().congestion_control_tag == kTPCC && | 396 if (GetParam().congestion_control_tag == kTPCC && |
400 FLAGS_quic_reloadable_flag_quic_enable_pcc) { | 397 FLAGS_quic_reloadable_flag_quic_enable_pcc) { |
401 copt.push_back(kTPCC); | 398 copt.push_back(kTPCC); |
402 } | 399 } |
403 | 400 |
404 if (support_server_push_) { | 401 if (support_server_push_) { |
405 copt.push_back(kSPSH); | 402 copt.push_back(kSPSH); |
406 } | 403 } |
(...skipping 1804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2211 QuicDispatcherPeer::GetAndClearLastError(dispatcher)); | 2208 QuicDispatcherPeer::GetAndClearLastError(dispatcher)); |
2212 server_thread_->Resume(); | 2209 server_thread_->Resume(); |
2213 | 2210 |
2214 // The connection should not be terminated. | 2211 // The connection should not be terminated. |
2215 EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo")); | 2212 EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo")); |
2216 EXPECT_EQ("200", client_->response_headers()->find(":status")->second); | 2213 EXPECT_EQ("200", client_->response_headers()->find(":status")->second); |
2217 } | 2214 } |
2218 | 2215 |
2219 TEST_P(EndToEndTest, CanceledStreamDoesNotBecomeZombie) { | 2216 TEST_P(EndToEndTest, CanceledStreamDoesNotBecomeZombie) { |
2220 ASSERT_TRUE(Initialize()); | 2217 ASSERT_TRUE(Initialize()); |
2221 if (GetParam().force_hol_blocking) { | |
2222 return; | |
2223 } | |
2224 EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed()); | 2218 EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed()); |
2225 // Lose the request. | 2219 // Lose the request. |
2226 SetPacketLossPercentage(100); | 2220 SetPacketLossPercentage(100); |
2227 SpdyHeaderBlock headers; | 2221 SpdyHeaderBlock headers; |
2228 headers[":method"] = "POST"; | 2222 headers[":method"] = "POST"; |
2229 headers[":path"] = "/foo"; | 2223 headers[":path"] = "/foo"; |
2230 headers[":scheme"] = "https"; | 2224 headers[":scheme"] = "https"; |
2231 headers[":authority"] = server_hostname_; | 2225 headers[":authority"] = server_hostname_; |
2232 client_->SendMessage(headers, "test_body", /*fin=*/false); | 2226 client_->SendMessage(headers, "test_body", /*fin=*/false); |
2233 QuicSpdyClientStream* stream = client_->GetOrCreateStream(); | 2227 QuicSpdyClientStream* stream = client_->GetOrCreateStream(); |
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3082 client_->WaitForResponse(); | 3076 client_->WaitForResponse(); |
3083 EXPECT_EQ(kBarResponseBody, client_->response_body()); | 3077 EXPECT_EQ(kBarResponseBody, client_->response_body()); |
3084 QuicConnectionStats client_stats = | 3078 QuicConnectionStats client_stats = |
3085 client_->client()->session()->connection()->GetStats(); | 3079 client_->client()->session()->connection()->GetStats(); |
3086 EXPECT_EQ(0u, client_stats.packets_lost); | 3080 EXPECT_EQ(0u, client_stats.packets_lost); |
3087 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos()); | 3081 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos()); |
3088 } | 3082 } |
3089 } // namespace | 3083 } // namespace |
3090 } // namespace test | 3084 } // namespace test |
3091 } // namespace net | 3085 } // namespace net |
OLD | NEW |