Change IETF Frame/QUIC_VERSION_99 tests to be symbolic.
This CL replaces checks for QUIC_VERSION_99 that are controlling the IETF frames and their associated functionality with a function call . The function has a name that is indicative of the features for which the version is being checked -- VersionHasIetfQuicFrames().
gfe-relnote: N/A just changes the text by which we test if IETF QUIC has been negotiated.
PiperOrigin-RevId: 253767805
Change-Id: I08ae6738411ac151f90d5d085ea69af90d79fb80
diff --git a/quic/core/http/end_to_end_test.cc b/quic/core/http/end_to_end_test.cc
index 01213d9..fa60c96 100644
--- a/quic/core/http/end_to_end_test.cc
+++ b/quic/core/http/end_to_end_test.cc
@@ -1473,8 +1473,9 @@
server_config_.SetMaxIncomingBidirectionalStreamsToSend(
kServerMaxIncomingDynamicStreams);
ASSERT_TRUE(Initialize());
- if (GetParam().negotiated_version.transport_version == QUIC_VERSION_99) {
- // Do not run this test for version 99/IETF QUIC. Note that the test needs
+ if (VersionHasIetfQuicFrames(
+ GetParam().negotiated_version.transport_version)) {
+ // Do not run this test for /IETF QUIC. Note that the test needs
// to be here, after calling Initialize(), because all tests end up calling
// EndToEndTest::TearDown(), which asserts that Initialize has been called
// and then proceeds to tear things down -- which fails if they are not
@@ -1532,7 +1533,8 @@
// returned by max_allowed... by 2 to remove the static streams from the
// count.
size_t client_max_open_outgoing_bidirectional_streams =
- client_session->connection()->transport_version() == QUIC_VERSION_99
+ VersionHasIetfQuicFrames(
+ client_session->connection()->transport_version())
? QuicSessionPeer::v99_streamid_manager(client_session)
->max_allowed_outgoing_bidirectional_streams() -
QuicSessionPeer::v99_bidirectional_stream_id_manager(
@@ -1541,7 +1543,8 @@
: QuicSessionPeer::GetStreamIdManager(client_session)
->max_open_outgoing_streams();
size_t client_max_open_outgoing_unidirectional_streams =
- client_session->connection()->transport_version() == QUIC_VERSION_99
+ VersionHasIetfQuicFrames(
+ client_session->connection()->transport_version())
? QuicSessionPeer::v99_streamid_manager(client_session)
->max_allowed_outgoing_unidirectional_streams() -
QuicSessionPeer::v99_unidirectional_stream_id_manager(
@@ -1556,13 +1559,15 @@
server_thread_->Pause();
QuicSession* server_session = GetServerSession();
size_t server_max_open_outgoing_bidirectional_streams =
- server_session->connection()->transport_version() == QUIC_VERSION_99
+ VersionHasIetfQuicFrames(
+ server_session->connection()->transport_version())
? QuicSessionPeer::v99_streamid_manager(server_session)
->max_allowed_outgoing_bidirectional_streams()
: QuicSessionPeer::GetStreamIdManager(server_session)
->max_open_outgoing_streams();
size_t server_max_open_outgoing_unidirectional_streams =
- server_session->connection()->transport_version() == QUIC_VERSION_99
+ VersionHasIetfQuicFrames(
+ server_session->connection()->transport_version())
? QuicSessionPeer::v99_streamid_manager(server_session)
->max_allowed_outgoing_unidirectional_streams() -
QuicSessionPeer::v99_unidirectional_stream_id_manager(
@@ -3765,7 +3770,7 @@
TEST_P(EndToEndTest, SimpleStopSendingTest) {
const uint16_t kStopSendingTestCode = 123;
ASSERT_TRUE(Initialize());
- if (negotiated_version_.transport_version != QUIC_VERSION_99) {
+ if (!VersionHasIetfQuicFrames(negotiated_version_.transport_version)) {
return;
}
QuicSession* client_session = client_->client()->client_session();
@@ -3959,7 +3964,7 @@
TEST_P(EndToEndTest, TooBigStreamIdClosesConnection) {
// Has to be before version test, see EndToEndTest::TearDown()
ASSERT_TRUE(Initialize());
- if (negotiated_version_.transport_version != QUIC_VERSION_99) {
+ if (!VersionHasIetfQuicFrames(negotiated_version_.transport_version)) {
// Only runs for IETF QUIC.
return;
}
diff --git a/quic/core/http/quic_server_session_base.cc b/quic/core/http/quic_server_session_base.cc
index 683793d..8670e29 100644
--- a/quic/core/http/quic_server_session_base.cc
+++ b/quic/core/http/quic_server_session_base.cc
@@ -224,7 +224,7 @@
}
if (!GetQuicReloadableFlag(quic_use_common_stream_check) &&
- connection()->transport_version() != QUIC_VERSION_99) {
+ !VersionHasIetfQuicFrames(connection()->transport_version())) {
if (GetNumOpenOutgoingStreams() >=
stream_id_manager().max_open_outgoing_streams()) {
QUIC_VLOG(1) << "No more streams should be created. "
@@ -248,7 +248,7 @@
}
if (!GetQuicReloadableFlag(quic_use_common_stream_check) &&
- connection()->transport_version() != QUIC_VERSION_99) {
+ !VersionHasIetfQuicFrames(connection()->transport_version())) {
if (GetNumOpenOutgoingStreams() >=
stream_id_manager().max_open_outgoing_streams()) {
QUIC_VLOG(1) << "No more streams should be created. "
diff --git a/quic/core/http/quic_server_session_base_test.cc b/quic/core/http/quic_server_session_base_test.cc
index a0ce23e..410161e 100644
--- a/quic/core/http/quic_server_session_base_test.cc
+++ b/quic/core/http/quic_server_session_base_test.cc
@@ -178,7 +178,7 @@
// expects needed to ensure that the STOP_SENDING worked as expected.
void InjectStopSendingFrame(QuicStreamId stream_id,
QuicRstStreamErrorCode rst_stream_code) {
- if (transport_version() != QUIC_VERSION_99) {
+ if (!VersionHasIetfQuicFrames(transport_version())) {
// Only needed for version 99/IETF QUIC. Noop otherwise.
return;
}
@@ -239,7 +239,7 @@
GetNthClientInitiatedBidirectionalId(0),
QUIC_ERROR_PROCESSING_STREAM, 0);
EXPECT_CALL(owner_, OnRstStreamReceived(_)).Times(1);
- if (transport_version() != QUIC_VERSION_99) {
+ if (!VersionHasIetfQuicFrames(transport_version())) {
// For non-version 99, the RESET_STREAM will do the full close.
// Set up expects accordingly.
EXPECT_CALL(*connection_, SendControlFrame(_));
@@ -270,7 +270,7 @@
GetNthClientInitiatedBidirectionalId(0),
QUIC_ERROR_PROCESSING_STREAM, 0);
EXPECT_CALL(owner_, OnRstStreamReceived(_)).Times(1);
- if (transport_version() != QUIC_VERSION_99) {
+ if (!VersionHasIetfQuicFrames(transport_version())) {
// For non-version 99, the RESET_STREAM will do the full close.
// Set up expects accordingly.
EXPECT_CALL(*connection_, SendControlFrame(_));
@@ -312,7 +312,7 @@
GetNthClientInitiatedBidirectionalId(0),
QUIC_ERROR_PROCESSING_STREAM, 0);
EXPECT_CALL(owner_, OnRstStreamReceived(_)).Times(1);
- if (transport_version() != QUIC_VERSION_99) {
+ if (!VersionHasIetfQuicFrames(transport_version())) {
// For non-version 99, the RESET_STREAM will do the full close.
// Set up expects accordingly.
EXPECT_CALL(*connection_, SendControlFrame(_));
@@ -348,7 +348,7 @@
// client FIN/RST is lost.
session_->OnConfigNegotiated();
- if (transport_version() != QUIC_VERSION_99) {
+ if (!VersionHasIetfQuicFrames(transport_version())) {
// The slightly increased stream limit is set during config negotiation. It
// is either an increase of 10 over negotiated limit, or a fixed percentage
// scaling, whichever is larger. Test both before continuing.
@@ -366,7 +366,7 @@
stream_id += QuicUtils::StreamIdDelta(connection_->transport_version());
}
- if (transport_version() != QUIC_VERSION_99) {
+ if (!VersionHasIetfQuicFrames(transport_version())) {
// Open more streams: server should accept slightly more than the limit.
// Excess streams are for non-version-99 only.
for (size_t i = 0; i < kMaxStreamsMinimumIncrement; ++i) {
@@ -378,7 +378,7 @@
// Now violate the server's internal stream limit.
stream_id += QuicUtils::StreamIdDelta(connection_->transport_version());
- if (transport_version() != QUIC_VERSION_99) {
+ if (!VersionHasIetfQuicFrames(transport_version())) {
// For non-version 99, QUIC responds to an attempt to exceed the stream
// limit by resetting the stream.
EXPECT_CALL(*connection_, CloseConnection(_, _, _)).Times(0);
@@ -412,7 +412,7 @@
QuicUtils::StreamIdDelta(connection_->transport_version());
const int kLimitingStreamId =
GetNthClientInitiatedBidirectionalId(kAvailableStreamLimit + 1);
- if (transport_version() != QUIC_VERSION_99) {
+ if (!VersionHasIetfQuicFrames(transport_version())) {
// This exceeds the stream limit. In versions other than 99
// this is allowed. Version 99 hews to the IETF spec and does
// not allow it.
diff --git a/quic/core/http/quic_spdy_client_session.cc b/quic/core/http/quic_spdy_client_session.cc
index 9be0936..ee81dcf 100644
--- a/quic/core/http/quic_spdy_client_session.cc
+++ b/quic/core/http/quic_spdy_client_session.cc
@@ -53,7 +53,7 @@
return false;
}
if (!GetQuicReloadableFlag(quic_use_common_stream_check) &&
- connection()->transport_version() != QUIC_VERSION_99) {
+ !VersionHasIetfQuicFrames(connection()->transport_version())) {
if (GetNumOpenOutgoingStreams() >=
stream_id_manager().max_open_outgoing_streams()) {
QUIC_DLOG(INFO) << "Failed to create a new outgoing stream. "
@@ -138,7 +138,7 @@
}
if (QuicUtils::IsClientInitiatedStreamId(connection()->transport_version(),
id) ||
- (connection()->transport_version() == QUIC_VERSION_99 &&
+ (VersionHasIetfQuicFrames(connection()->transport_version()) &&
QuicUtils::IsBidirectionalStreamId(id))) {
QUIC_LOG(WARNING) << "Received invalid push stream id " << id;
connection()->CloseConnection(
diff --git a/quic/core/http/quic_spdy_client_session_test.cc b/quic/core/http/quic_spdy_client_session_test.cc
index bfde618..02c4a14 100644
--- a/quic/core/http/quic_spdy_client_session_test.cc
+++ b/quic/core/http/quic_spdy_client_session_test.cc
@@ -142,7 +142,7 @@
}
void CompleteCryptoHandshake(uint32_t server_max_incoming_streams) {
- if (connection_->transport_version() == QUIC_VERSION_99) {
+ if (VersionHasIetfQuicFrames(connection_->transport_version())) {
EXPECT_CALL(*connection_, SendControlFrame(_))
.Times(testing::AnyNumber())
.WillRepeatedly(Invoke(
@@ -152,7 +152,7 @@
QuicCryptoClientStream* stream = static_cast<QuicCryptoClientStream*>(
session_->GetMutableCryptoStream());
QuicConfig config = DefaultQuicConfig();
- if (connection_->transport_version() == QUIC_VERSION_99) {
+ if (VersionHasIetfQuicFrames(connection_->transport_version())) {
config.SetMaxIncomingUnidirectionalStreamsToSend(
server_max_incoming_streams);
config.SetMaxIncomingBidirectionalStreamsToSend(
@@ -259,7 +259,7 @@
stream = session_->CreateOutgoingBidirectionalStream();
EXPECT_FALSE(stream);
- if (GetParam().transport_version == QUIC_VERSION_99) {
+ if (VersionHasIetfQuicFrames(GetParam().transport_version)) {
if (VersionLacksHeadersStream(GetParam().transport_version)) {
EXPECT_EQ(1u,
QuicSessionPeer::v99_bidirectional_stream_id_manager(&*session_)
@@ -305,7 +305,7 @@
QUIC_RST_ACKNOWLEDGEMENT, 0));
// Check that a new one can be created.
EXPECT_EQ(0u, session_->GetNumOpenOutgoingStreams());
- if (GetParam().transport_version == QUIC_VERSION_99) {
+ if (VersionHasIetfQuicFrames(GetParam().transport_version)) {
// In V99 the stream limit increases only if we get a MAX_STREAMS
// frame; pretend we got one.
@@ -322,7 +322,7 @@
}
stream = session_->CreateOutgoingBidirectionalStream();
EXPECT_NE(nullptr, stream);
- if (GetParam().transport_version == QUIC_VERSION_99) {
+ if (VersionHasIetfQuicFrames(GetParam().transport_version)) {
// Ensure that we have/have had three open streams: two test streams and the
// header stream.
QuicStreamCount expected_stream_count = 3;
@@ -355,7 +355,7 @@
QuicSpdyClientStream* stream = session_->CreateOutgoingBidirectionalStream();
ASSERT_NE(nullptr, stream);
- if (GetParam().transport_version == QUIC_VERSION_99) {
+ if (VersionHasIetfQuicFrames(GetParam().transport_version)) {
// For v99, trying to open a stream and failing due to lack
// of stream ids will result in a STREAMS_BLOCKED. Make
// sure we get one. Also clear out the frame because if it's
@@ -394,7 +394,7 @@
// The stream is now complete from the client's perspective, and it should
// be able to create a new outgoing stream.
EXPECT_EQ(0u, session_->GetNumOpenOutgoingStreams());
- if (GetParam().transport_version == QUIC_VERSION_99) {
+ if (VersionHasIetfQuicFrames(GetParam().transport_version)) {
// Note that this is to be the second stream created, hence
// the stream count is 3 (the two streams created as a part of
// the test plus the header stream, internally created).
@@ -409,7 +409,7 @@
}
stream = session_->CreateOutgoingBidirectionalStream();
EXPECT_NE(nullptr, stream);
- if (GetParam().transport_version == QUIC_VERSION_99) {
+ if (VersionHasIetfQuicFrames(GetParam().transport_version)) {
// Ensure that we have/have had three open streams: two test streams and the
// header stream.
QuicStreamCount expected_stream_count = 3;
@@ -480,7 +480,7 @@
}
TEST_P(QuicSpdyClientSessionTest, GoAwayReceived) {
- if (connection_->transport_version() == QUIC_VERSION_99) {
+ if (VersionHasIetfQuicFrames(connection_->transport_version())) {
return;
}
CompleteCryptoHandshake();
@@ -874,7 +874,7 @@
TEST_P(QuicSpdyClientSessionTest,
TryToCreateServerInitiatedBidirectionalStream) {
- if (connection_->transport_version() == QUIC_VERSION_99) {
+ if (VersionHasIetfQuicFrames(connection_->transport_version())) {
EXPECT_CALL(*connection_, CloseConnection(QUIC_INVALID_STREAM_ID, _, _));
} else {
EXPECT_CALL(*connection_, CloseConnection(_, _, _)).Times(0);
diff --git a/quic/core/http/quic_spdy_server_stream_base_test.cc b/quic/core/http/quic_spdy_server_stream_base_test.cc
index 4e1aa1b..15638ca 100644
--- a/quic/core/http/quic_spdy_server_stream_base_test.cc
+++ b/quic/core/http/quic_spdy_server_stream_base_test.cc
@@ -59,7 +59,7 @@
EXPECT_CALL(session_, SendRstStream(_, QUIC_STREAM_NO_ERROR, _)).Times(0);
- if (session_.connection()->transport_version() != QUIC_VERSION_99) {
+ if (!VersionHasIetfQuicFrames(session_.connection()->transport_version())) {
EXPECT_CALL(session_, SendRstStream(_, QUIC_RST_ACKNOWLEDGEMENT, _))
.Times(1);
} else {
@@ -76,7 +76,7 @@
QuicRstStreamFrame rst_frame(kInvalidControlFrameId, stream_->id(),
QUIC_STREAM_CANCELLED, 1234);
stream_->OnStreamReset(rst_frame);
- if (session_.connection()->transport_version() == QUIC_VERSION_99) {
+ if (VersionHasIetfQuicFrames(session_.connection()->transport_version())) {
// Create and inject a STOP SENDING frame to complete the close
// of the stream. This is only needed for version 99/IETF QUIC.
QuicStopSendingFrame stop_sending(
diff --git a/quic/core/http/quic_spdy_session_test.cc b/quic/core/http/quic_spdy_session_test.cc
index ce4d5a9..5b926db 100644
--- a/quic/core/http/quic_spdy_session_test.cc
+++ b/quic/core/http/quic_spdy_session_test.cc
@@ -176,7 +176,7 @@
// Enforce the limit on the number of open streams.
if (GetNumOpenIncomingStreams() + 1 >
max_open_incoming_bidirectional_streams() &&
- connection()->transport_version() != QUIC_VERSION_99) {
+ !VersionHasIetfQuicFrames(connection()->transport_version())) {
connection()->CloseConnection(
QUIC_TOO_MANY_OPEN_STREAMS, "Too many streams!",
ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
@@ -320,7 +320,7 @@
}
void CloseStream(QuicStreamId id) {
- if (!IsVersion99()) {
+ if (!VersionHasIetfQuicFrames(transport_version())) {
EXPECT_CALL(*connection_, SendControlFrame(_))
.WillOnce(Invoke(&session_, &TestSession::ClearControlFrame));
} else {
@@ -338,8 +338,6 @@
return connection_->transport_version();
}
- bool IsVersion99() const { return transport_version() == QUIC_VERSION_99; }
-
QuicStreamId GetNthClientInitiatedBidirectionalId(int n) {
return GetNthClientInitiatedBidirectionalStreamId(transport_version(), n);
}
@@ -368,7 +366,7 @@
// needs to do the stream count where #1 is 0/1/2/3, and not
// take into account that stream 0 is special.
QuicStreamId id =
- ((stream_count - 1) * QuicUtils::StreamIdDelta(QUIC_VERSION_99));
+ ((stream_count - 1) * QuicUtils::StreamIdDelta(transport_version()));
if (!bidirectional) {
id |= 0x2;
}
@@ -478,7 +476,7 @@
}
TEST_P(QuicSpdySessionTestServer, MaximumAvailableOpenedStreams) {
- if (IsVersion99()) {
+ if (VersionHasIetfQuicFrames(transport_version())) {
// For IETF QUIC, we should be able to obtain the max allowed
// stream ID, the next ID should fail. Since the actual limit
// is not the number of open streams, we allocate the max and the max+2.
@@ -535,7 +533,7 @@
// A stream ID which is too large to create.
stream_id2 = GetNthClientInitiatedBidirectionalId(
2 * session_.MaxAvailableBidirectionalStreams() + 4);
- if (IsVersion99()) {
+ if (VersionHasIetfQuicFrames(transport_version())) {
EXPECT_CALL(*connection_, CloseConnection(QUIC_INVALID_STREAM_ID, _, _));
} else {
EXPECT_CALL(*connection_,
@@ -547,7 +545,7 @@
TEST_P(QuicSpdySessionTestServer, ManyAvailableStreams) {
// When max_open_streams_ is 200, should be able to create 200 streams
// out-of-order, that is, creating the one with the largest stream ID first.
- if (IsVersion99()) {
+ if (VersionHasIetfQuicFrames(transport_version())) {
QuicSessionPeer::SetMaxOpenIncomingBidirectionalStreams(&session_, 200);
} else {
QuicSessionPeer::SetMaxOpenIncomingStreams(&session_, 200);
@@ -688,7 +686,7 @@
}
TEST_P(QuicSpdySessionTestServer, OnCanWriteBundlesStreams) {
- if (IsVersion99()) {
+ if (VersionHasIetfQuicFrames(transport_version())) {
EXPECT_CALL(*connection_, SendControlFrame(_))
.WillRepeatedly(Invoke(
this, &QuicSpdySessionTestServer::ClearMaxStreamsControlFrame));
@@ -957,7 +955,7 @@
}
TEST_P(QuicSpdySessionTestServer, SendGoAway) {
- if (IsVersion99()) {
+ if (VersionHasIetfQuicFrames(transport_version())) {
// GoAway frames are not in version 99
return;
}
@@ -981,7 +979,7 @@
}
TEST_P(QuicSpdySessionTestServer, DoNotSendGoAwayTwice) {
- if (IsVersion99()) {
+ if (VersionHasIetfQuicFrames(transport_version())) {
// TODO(b/118808809): Enable this test for version 99 when GOAWAY is
// supported.
return;
@@ -994,7 +992,7 @@
}
TEST_P(QuicSpdySessionTestServer, InvalidGoAway) {
- if (IsVersion99()) {
+ if (VersionHasIetfQuicFrames(transport_version())) {
// TODO(b/118808809): Enable this test for version 99 when GOAWAY is
// supported.
return;
@@ -1016,7 +1014,7 @@
EXPECT_CALL(*connection_,
SendConnectivityProbingResponsePacket(new_peer_address));
- if (IsVersion99()) {
+ if (VersionHasIetfQuicFrames(transport_version())) {
// Need to explicitly do this to emulate the reception of a PathChallenge,
// which stores its payload for use in generating the response.
connection_->OnPathChallengeFrame(
@@ -1045,7 +1043,7 @@
EXPECT_EQ(1u, session_.GetNumOpenIncomingStreams());
EXPECT_CALL(*connection_, SendControlFrame(_));
- if (!IsVersion99()) {
+ if (!VersionHasIetfQuicFrames(transport_version())) {
// For version99, OnStreamReset gets called because of the STOP_SENDING,
// below. EXPECT the call there.
EXPECT_CALL(*connection_,
@@ -1059,7 +1057,7 @@
// Create and inject a STOP_SENDING frame. In GOOGLE QUIC, receiving a
// RST_STREAM frame causes a two-way close. For IETF QUIC, RST_STREAM causes a
// one-way close.
- if (IsVersion99()) {
+ if (VersionHasIetfQuicFrames(transport_version())) {
// Only needed for version 99/IETF QUIC.
QuicStopSendingFrame stop_sending(
kInvalidControlFrameId, GetNthClientInitiatedBidirectionalId(0),
@@ -1182,7 +1180,7 @@
EXPECT_FALSE(headers_stream->flow_controller()->IsBlocked());
EXPECT_FALSE(session_.IsConnectionFlowControlBlocked());
EXPECT_FALSE(session_.IsStreamFlowControlBlocked());
- if (IsVersion99()) {
+ if (VersionHasIetfQuicFrames(transport_version())) {
EXPECT_CALL(*connection_, SendControlFrame(_))
.WillOnce(Invoke(&session_, &TestSession::ClearControlFrame));
} else {
@@ -1311,7 +1309,7 @@
EXPECT_CALL(*connection_, SendControlFrame(_))
.Times(2)
.WillRepeatedly(Invoke(&session_, &TestSession::ClearControlFrame));
- if (!IsVersion99()) {
+ if (!VersionHasIetfQuicFrames(transport_version())) {
// For version99 the call to OnStreamReset happens as a result of receiving
// the STOP_SENDING, so set up the EXPECT there.
EXPECT_CALL(*connection_, OnStreamReset(stream->id(), _));
@@ -1322,7 +1320,7 @@
// Create and inject a STOP_SENDING frame. In GOOGLE QUIC, receiving a
// RST_STREAM frame causes a two-way close. For IETF QUIC, RST_STREAM causes a
// one-way close.
- if (IsVersion99()) {
+ if (VersionHasIetfQuicFrames(transport_version())) {
// Only needed for version 99/IETF QUIC.
QuicStopSendingFrame stop_sending(
kInvalidControlFrameId, stream->id(),
@@ -1539,7 +1537,7 @@
// with a FIN or RST then we send an RST to refuse streams for versions other
// than version 99. In version 99 the connection gets closed.
const QuicStreamId kMaxStreams = 5;
- if (IsVersion99()) {
+ if (VersionHasIetfQuicFrames(transport_version())) {
QuicSessionPeer::SetMaxOpenIncomingBidirectionalStreams(&session_,
kMaxStreams);
} else {
@@ -1566,7 +1564,7 @@
QuicStreamFrame data1(i, false, 0, QuicStringPiece("HT"));
session_.OnStreamFrame(data1);
// EXPECT_EQ(1u, session_.GetNumOpenStreams());
- if (!IsVersion99()) {
+ if (!VersionHasIetfQuicFrames(transport_version())) {
EXPECT_CALL(*connection_, SendControlFrame(_))
.WillOnce(Invoke(&session_, &TestSession::ClearControlFrame));
} else {
@@ -1582,7 +1580,7 @@
session_.CloseStream(i);
}
// Try and open a stream that exceeds the limit.
- if (!IsVersion99()) {
+ if (!VersionHasIetfQuicFrames(transport_version())) {
// On versions other than 99, opening such a stream results in a
// RST_STREAM.
EXPECT_CALL(*connection_, SendControlFrame(_)).Times(1);
@@ -1607,7 +1605,7 @@
// Verify that a draining stream (which has received a FIN but not consumed
// it) does not count against the open quota (because it is closed from the
// protocol point of view).
- if (IsVersion99()) {
+ if (VersionHasIetfQuicFrames(transport_version())) {
// Version 99 will result in a MAX_STREAMS frame as streams are consumed
// (via the OnStreamFrame call) and then released (via
// StreamDraining). Eventually this node will believe that the peer is
@@ -1619,7 +1617,7 @@
}
EXPECT_CALL(*connection_, OnStreamReset(_, QUIC_REFUSED_STREAM)).Times(0);
const QuicStreamId kMaxStreams = 5;
- if (IsVersion99()) {
+ if (VersionHasIetfQuicFrames(transport_version())) {
QuicSessionPeer::SetMaxOpenIncomingBidirectionalStreams(&session_,
kMaxStreams);
} else {