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

Unified Diff: net/tools/quic/end_to_end_test.cc

Issue 2542743003: Make QuicClientBase::WaitForCryptoHandshakeComplete return false if the handshake fails. There's cu… (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/tools/quic/quic_client_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/end_to_end_test.cc
diff --git a/net/tools/quic/end_to_end_test.cc b/net/tools/quic/end_to_end_test.cc
index b9385d5085db24991baaaa4dd53aeca44b8d2c37..a8f09094b2722aac1d9b71d4a0199d53997efee9 100644
--- a/net/tools/quic/end_to_end_test.cc
+++ b/net/tools/quic/end_to_end_test.cc
@@ -581,7 +581,7 @@ INSTANTIATE_TEST_CASE_P(EndToEndTests,
TEST_P(EndToEndTest, HandshakeSuccessful) {
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
QuicCryptoStream* crypto_stream =
QuicSessionPeer::GetCryptoStream(client_->client()->session());
QuicStreamSequencer* sequencer = QuicStreamPeer::sequencer(crypto_stream);
@@ -729,7 +729,7 @@ TEST_P(EndToEndTest, PostMissingBytes) {
TEST_P(EndToEndTest, LargePostNoPacketLoss) {
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
// 1 MB body.
string body(1024 * 1024, 'a');
@@ -750,7 +750,7 @@ TEST_P(EndToEndTest, LargePostNoPacketLoss1sRTT) {
ASSERT_TRUE(Initialize());
SetPacketSendDelay(QuicTime::Delta::FromMilliseconds(1000));
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
// 100 KB body.
string body(100 * 1024, 'a');
@@ -777,7 +777,7 @@ TEST_P(EndToEndTest, LargePostWithPacketLoss) {
ASSERT_TRUE(Initialize());
// Wait for the server SHLO before upping the packet loss.
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
SetPacketLossPercentage(30);
// 10 KB body.
@@ -804,7 +804,7 @@ TEST_P(EndToEndTest, LargePostWithPacketLossAndBlockedSocket) {
ASSERT_TRUE(Initialize());
// Wait for the server SHLO before upping the packet loss.
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
SetPacketLossPercentage(10);
client_writer_->set_fake_blocked_socket_percentage(10);
@@ -823,7 +823,7 @@ TEST_P(EndToEndTest, LargePostWithPacketLossAndBlockedSocket) {
TEST_P(EndToEndTest, LargePostNoPacketLossWithDelayAndReordering) {
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
// Both of these must be called when the writer is not actively used.
SetPacketSendDelay(QuicTime::Delta::FromMilliseconds(2));
SetReorderPercentage(30);
@@ -1027,7 +1027,7 @@ TEST_P(EndToEndTest, SetInitialReceivedConnectionOptions) {
initial_received_options));
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
server_thread_->WaitForCryptoHandshakeConfirmed();
EXPECT_FALSE(server_config_.SetInitialReceivedConnectionOptions(
@@ -1052,7 +1052,7 @@ TEST_P(EndToEndTest, LargePostSmallBandwidthLargeBuffer) {
server_writer_->set_max_bandwidth_and_buffer_size(
QuicBandwidth::FromBytesPerSecond(256 * 1024), 256 * 1024);
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
// 1 MB body.
string body(1024 * 1024, 'a');
@@ -1076,7 +1076,7 @@ TEST_P(EndToEndTest, DoNotSetResumeWriteAlarmIfConnectionFlowControlBlocked) {
// an infinite loop in the EpollServer, as the alarm fires and is immediately
// rescheduled.
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
// Ensure both stream and connection level are flow control blocked by setting
// the send window offset to 0.
@@ -1111,7 +1111,7 @@ TEST_P(EndToEndTest, DoNotSetResumeWriteAlarmIfConnectionFlowControlBlocked) {
TEST_P(EndToEndTest, InvalidStream) {
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
string body(kMaxPacketSize, 'a');
SpdyHeaderBlock headers;
@@ -1133,7 +1133,7 @@ TEST_P(EndToEndTest, InvalidStream) {
// to send a request with overly large headers.
TEST_P(EndToEndTest, LargeHeaders) {
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
string body(kMaxPacketSize, 'a');
SpdyHeaderBlock headers;
@@ -1158,7 +1158,7 @@ TEST_P(EndToEndTest, LargeHeaders) {
TEST_P(EndToEndTest, EarlyResponseWithQuicStreamNoError) {
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
string large_body(1024 * 1024, 'a');
SpdyHeaderBlock headers;
@@ -1213,7 +1213,7 @@ TEST_P(EndToEndTest, NegotiateMaxOpenStreams) {
// Negotiate 1 max open stream.
client_config_.SetMaxStreamsPerConnection(1, 1);
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
if (negotiated_version_ > QUIC_VERSION_34) {
// Newer versions use max incoming dynamic streams.
@@ -1251,7 +1251,7 @@ TEST_P(EndToEndTest, MaxIncomingDynamicStreamsLimitRespected) {
server_config_.SetMaxIncomingDynamicStreamsToSend(
kServerMaxIncomingDynamicStreams);
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
if (negotiated_version_ <= QUIC_VERSION_34) {
// Earlier versions negotiated max open streams.
@@ -1292,7 +1292,7 @@ TEST_P(EndToEndTest, SetIndependentMaxIncomingDynamicStreamsLimits) {
server_config_.SetMaxIncomingDynamicStreamsToSend(
kServerMaxIncomingDynamicStreams);
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
if (negotiated_version_ <= QUIC_VERSION_34) {
// Earlier versions negotiated max open streams.
@@ -1317,7 +1317,7 @@ TEST_P(EndToEndTest, NegotiateCongestionControl) {
// static_cast here does not work.
FLAGS_quic_enable_multipath = false;
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
CongestionControlType expected_congestion_control_type = kReno;
switch (GetParam().congestion_control_tag) {
@@ -1351,7 +1351,7 @@ TEST_P(EndToEndTest, LimitMaxOpenStreams) {
client_config_.SetMaxStreamsPerConnection(10, 5);
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
if (negotiated_version_ > QUIC_VERSION_34) {
// No negotiated max streams beyond version 34.
return;
@@ -1366,7 +1366,7 @@ TEST_P(EndToEndTest, ClientSuggestsRTT) {
client_config_.SetInitialRoundTripTimeUsToSend(kInitialRTT);
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
server_thread_->WaitForCryptoHandshakeConfirmed();
// Pause the server so we can access the server's internals without races.
@@ -1393,7 +1393,7 @@ TEST_P(EndToEndTest, MaxInitialRTT) {
kMaxInitialRoundTripTimeUs);
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
server_thread_->WaitForCryptoHandshakeConfirmed();
// Pause the server so we can access the server's internals without races.
@@ -1423,7 +1423,7 @@ TEST_P(EndToEndTest, MinInitialRTT) {
client_config_.SetInitialRoundTripTimeUsToSend(0);
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
server_thread_->WaitForCryptoHandshakeConfirmed();
// Pause the server so we can access the server's internals without races.
@@ -1512,7 +1512,7 @@ TEST_P(EndToEndTest, MaxStreamsUberTest) {
AddToCache("/large_response", 200, large_body);
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
SetPacketLossPercentage(10);
for (int i = 0; i < max_streams; ++i) {
@@ -1531,7 +1531,7 @@ TEST_P(EndToEndTest, StreamCancelErrorTest) {
AddToCache("/small_response", 200, small_body);
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
QuicSession* session = client_->client()->session();
// Lose the request.
@@ -1659,7 +1659,7 @@ TEST_P(EndToEndTest, DifferentFlowControlWindows) {
ASSERT_TRUE(Initialize());
// Values are exchanged during crypto handshake, so wait for that to finish.
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
server_thread_->WaitForCryptoHandshakeConfirmed();
// Open a data stream to make sure the stream level flow control is updated.
@@ -1712,7 +1712,7 @@ TEST_P(EndToEndTest, HeadersAndCryptoStreamsNoConnectionFlowControl) {
// Wait for crypto handshake to finish. This should have contributed to the
// crypto stream flow control window, but not affected the session flow
// control window.
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
server_thread_->WaitForCryptoHandshakeConfirmed();
QuicCryptoStream* crypto_stream =
@@ -1755,7 +1755,7 @@ TEST_P(EndToEndTest, FlowControlsSynced) {
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
server_thread_->WaitForCryptoHandshakeConfirmed();
server_thread_->Pause();
@@ -1855,7 +1855,7 @@ TEST_P(EndToEndTest, AckNotifierWithPacketLossAndBlockedSocket) {
ASSERT_TRUE(Initialize());
// Wait for the server SHLO before upping the packet loss.
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
SetPacketLossPercentage(30);
client_writer_->set_fake_blocked_socket_percentage(10);
@@ -1927,7 +1927,7 @@ TEST_P(EndToEndTest, ServerSendPublicReset) {
TEST_P(EndToEndTest, ServerSendPublicResetWithDifferentConnectionId) {
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
// Send the public reset.
QuicConnectionId incorrect_connection_id =
@@ -1992,7 +1992,7 @@ TEST_P(EndToEndTest, ClientSendPublicResetWithDifferentConnectionId) {
TEST_P(EndToEndTest, ServerSendVersionNegotiationWithDifferentConnectionId) {
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
// Send the version negotiation packet.
QuicConnectionId incorrect_connection_id =
@@ -2383,7 +2383,7 @@ TEST_P(EndToEndTest, EarlyResponseFinRecording) {
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
// A POST that gets an early error response, after the headers are received
// and before the body is received, due to invalid content-length.
@@ -2437,7 +2437,7 @@ TEST_P(EndToEndTest, LargePostEarlyResponse) {
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
// POST to a URL that gets an early error response, after the headers are
// received and before the body is received.
@@ -2467,7 +2467,7 @@ TEST_P(EndToEndTest, LargePostEarlyResponse) {
TEST_P(EndToEndTest, Trailers) {
// Test sending and receiving HTTP/2 Trailers (trailing HEADERS frames).
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
// Set reordering to ensure that Trailers arriving before body is ok.
SetPacketSendDelay(QuicTime::Delta::FromMilliseconds(2));
@@ -2549,7 +2549,7 @@ INSTANTIATE_TEST_CASE_P(EndToEndTestsServerPush,
TEST_P(EndToEndTestServerPush, ServerPush) {
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
// Set reordering to ensure that body arriving before PUSH_PROMISE is ok.
SetPacketSendDelay(QuicTime::Delta::FromMilliseconds(2));
@@ -2596,7 +2596,7 @@ TEST_P(EndToEndTestServerPush, ServerPushUnderLimit) {
// them with requests later.
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
// Set reordering to ensure that body arriving before PUSH_PROMISE is ok.
SetPacketSendDelay(QuicTime::Delta::FromMilliseconds(2));
@@ -2643,7 +2643,7 @@ TEST_P(EndToEndTestServerPush, ServerPushOverLimitNonBlocking) {
// streams should still work because all response streams get closed
// immediately after pushing resources.
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
// Set reordering to ensure that body arriving before PUSH_PROMISE is ok.
SetPacketSendDelay(QuicTime::Delta::FromMilliseconds(2));
@@ -2701,7 +2701,7 @@ TEST_P(EndToEndTestServerPush, ServerPushOverLimitWithBlocking) {
kBodySize * kNumMaxStreams + 1024);
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
// Set reordering to ensure that body arriving before PUSH_PROMISE is ok.
SetPacketSendDelay(QuicTime::Delta::FromMilliseconds(2));
@@ -2814,7 +2814,7 @@ TEST_P(EndToEndTest, DISABLED_TestHugePostWithPacketLoss) {
// within a short time.
client_->epoll_server()->set_timeout_in_us(0);
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
SetPacketLossPercentage(1);
// To avoid storing the whole request body in memory, use a loop to repeatedly
// send body size of kSizeBytes until the whole request body size is reached.
@@ -2871,7 +2871,7 @@ TEST_P(EndToEndTest, DISABLED_TestHugeResponseWithPacketLoss) {
initialized_ = true;
ASSERT_TRUE(client_->client()->connected());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
SetPacketLossPercentage(1);
client_->SendRequest("/huge_response");
client_->WaitForResponse();
« no previous file with comments | « no previous file | net/tools/quic/quic_client_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698