Minor improvements to quic/core/http:end_to_end_test
Add expectations on error codes to CheckResponse(). This may provide
potentially useful output on failure.
Fix comments in AckNotifierWithPacketLossAndBlockedSocket. There were two
scenarios before cl/312324172, in which I failed to update one comment.
Verify response to bar request in AckNotifierWithPacketLossAndBlockedSocket test
using SendSynchronousBarRequestAndCheckResponse().
Test-only change.
PiperOrigin-RevId: 321195032
Change-Id: I72d9badc4814a87dc7db88087a2d3c854c45705c
diff --git a/quic/core/http/end_to_end_test.cc b/quic/core/http/end_to_end_test.cc
index 4973934..e5d6347 100644
--- a/quic/core/http/end_to_end_test.cc
+++ b/quic/core/http/end_to_end_test.cc
@@ -629,6 +629,9 @@
bool CheckResponse(QuicTestClient* client,
const std::string& received_response,
const std::string& expected_response) {
+ EXPECT_THAT(client_->stream_error(), IsQuicStreamNoError());
+ EXPECT_THAT(client_->connection_error(), IsQuicNoError());
+
if (received_response.empty() && !expected_response.empty()) {
ADD_FAILURE() << "Failed to get any response for request";
return false;
@@ -2662,7 +2665,7 @@
TEST_P(EndToEndTest, AckNotifierWithPacketLossAndBlockedSocket) {
// Verify that even in the presence of packet loss and occasionally blocked
- // socket, an AckNotifierDelegate will get informed that the data it is
+ // socket, an AckNotifierDelegate will get informed that the data it is
// interested in has been ACKed. This tests end-to-end ACK notification, and
// demonstrates that retransmissions do not break this functionality.
// Disable blackhole detection as this test is testing loss recovery.
@@ -2716,7 +2719,7 @@
// the header stream.
size_t header_size = 0;
if (version_.UsesHttp3()) {
- // Determine size of headers after QPACK compression in both scenarios.
+ // Determine size of headers after QPACK compression.
NoopDecoderStreamErrorDelegate decoder_stream_error_delegate;
NoopQpackStreamSenderDelegate encoder_stream_sender_delegate;
QpackEncoder qpack_encoder(&decoder_stream_error_delegate);
@@ -2749,7 +2752,7 @@
WaitForFooResponseAndCheckIt();
// Send another request to flush out any pending ACKs on the server.
- client_->SendSynchronousRequest("/bar");
+ SendSynchronousBarRequestAndCheckResponse();
// Make sure the delegate does get the notification it expects.
while (ack_listener->total_bytes_acked() < expected_bytes_acked) {