Fix original issue of QNZR by only forcing the first CHLO to be inchoate.
Also replace the connection option with QNZ2.
Manually tested with netlog at https://drive.google.com/file/d/1WDFHBZJGy9ZM6hXwriyH3GEjvgdUVy4W/view?usp=sharing
Protected by client connection option QNZ2.
PiperOrigin-RevId: 338360564
Change-Id: I1cac9589006b59ff32dbd325e97ca77d70e2b6cb
diff --git a/quic/core/quic_crypto_client_stream_test.cc b/quic/core/quic_crypto_client_stream_test.cc
index eef6b49..86fa3b8 100644
--- a/quic/core/quic_crypto_client_stream_test.cc
+++ b/quic/core/quic_crypto_client_stream_test.cc
@@ -69,7 +69,8 @@
void CompleteCryptoHandshake() {
int proof_verify_details_calls = 1;
if (stream()->handshake_protocol() != PROTOCOL_TLS1_3) {
- EXPECT_CALL(*session_, OnProofValid(testing::_));
+ EXPECT_CALL(*session_, OnProofValid(testing::_))
+ .Times(testing::AtLeast(1));
proof_verify_details_calls = 0;
}
EXPECT_CALL(*session_, OnProofVerifyDetailsAvailable(testing::_))
@@ -172,14 +173,13 @@
// Set connection option.
QuicTagVector options;
- options.push_back(kQNZR);
+ options.push_back(kQNZ2);
session_->config()->SetClientConnectionOptions(options);
- EXPECT_CALL(*session_, OnProofValid(testing::_));
- stream()->CryptoConnect();
- // Check that a client hello was sent.
- ASSERT_EQ(1u, connection_->encrypted_packets_.size());
- EXPECT_EQ(ENCRYPTION_INITIAL, connection_->encryption_level());
+ CompleteCryptoHandshake();
+ // Check that two client hellos were sent, one inchoate and one normal.
+ EXPECT_EQ(2, stream()->num_sent_client_hellos());
+ EXPECT_FALSE(stream()->EarlyDataAccepted());
EXPECT_EQ(stream()->EarlyDataReason(), ssl_early_data_disabled);
}