Commit 7acef7f9 authored by Ryan Hamilton's avatar Ryan Hamilton Committed by Commit Bot

Fix a P2PQuic test to correctly grok v99 RST_STREAM semantics.

This is a partial re-land of http://crrev.com/c/1825657

Change-Id: Idde7813cc214ddf6f2a0f5b15b29bbd909ff5c7f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1849201
Auto-Submit: Ryan Hamilton <rch@chromium.org>
Commit-Queue: Steve Anton <steveanton@chromium.org>
Reviewed-by: default avatarSteve Anton <steveanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704301}
parent 403a4da4
...@@ -174,7 +174,23 @@ TEST_F(P2PQuicStreamTest, StreamClosedAfterReceivingReset) { ...@@ -174,7 +174,23 @@ TEST_F(P2PQuicStreamTest, StreamClosedAfterReceivingReset) {
quic::QuicRstStreamFrame rst_frame(quic::kInvalidControlFrameId, kStreamId, quic::QuicRstStreamFrame rst_frame(quic::kInvalidControlFrameId, kStreamId,
quic::QUIC_STREAM_CANCELLED, 0); quic::QUIC_STREAM_CANCELLED, 0);
if (!VersionHasIetfQuicFrames(connection_->version().transport_version)) {
// Google RST_STREAM closes the stream in both directions. A RST_STREAM
// is then sent to the peer to communicate the final byte offset.
EXPECT_CALL(session_,
SendRstStream(kStreamId, quic::QUIC_RST_ACKNOWLEDGEMENT, 0));
}
stream_->OnStreamReset(rst_frame); stream_->OnStreamReset(rst_frame);
if (VersionHasIetfQuicFrames(connection_->version().transport_version)) {
// In IETF QUIC, the RST_STREAM only closes the stream in one direction.
// A STOP_SENDING frame in require to induce the a RST_STREAM being
// send to close the other direction.
EXPECT_CALL(*connection_, SendControlFrame(_));
EXPECT_CALL(*connection_, OnStreamReset(kStreamId, testing::_));
quic::QuicStopSendingFrame stop_sending_frame(quic::kInvalidControlFrameId,
kStreamId, 0);
session_.OnStopSendingFrame(stop_sending_frame);
}
EXPECT_TRUE(stream_->IsClosedForTesting()); EXPECT_TRUE(stream_->IsClosedForTesting());
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment