Remove kV99StreamIdIncrement from QuicStreamIdManager.
It's hard coded with the same value as QuicUtils::StreamIdDelta(). There should be only one source of truth.
gfe-relnote: no behavior change. not protected.
PiperOrigin-RevId: 304467242
Change-Id: I81861a89c913d033212d6c5e86181c7cd92636b7
diff --git a/quic/core/quic_stream_id_manager_test.cc b/quic/core/quic_stream_id_manager_test.cc
index 3207e59..81198f8 100644
--- a/quic/core/quic_stream_id_manager_test.cc
+++ b/quic/core/quic_stream_id_manager_test.cc
@@ -84,7 +84,7 @@
// Returns the stream ID for the Nth incoming stream (created by the peer)
// of the corresponding directionality of this manager.
QuicStreamId GetNthIncomingStreamId(int n) {
- return kV99StreamIdIncrement * n +
+ return QuicUtils::StreamIdDelta(transport_version()) * n +
(IsUnidirectional()
? QuicUtils::GetFirstUnidirectionalStreamId(
transport_version(),
@@ -290,7 +290,7 @@
while (number_of_streams) {
EXPECT_TRUE(stream_id_manager_.CanOpenNextOutgoingStream());
EXPECT_EQ(stream_id, stream_id_manager_.GetNextOutgoingStreamId());
- stream_id += kV99StreamIdIncrement;
+ stream_id += QuicUtils::StreamIdDelta(transport_version());
number_of_streams--;
}
@@ -316,11 +316,13 @@
// A bad stream ID results in a closed connection.
std::string error_details;
EXPECT_FALSE(stream_id_manager_.MaybeIncreaseLargestPeerStreamId(
- max_stream_id + kV99StreamIdIncrement, &error_details));
- EXPECT_EQ(
- error_details,
- quiche::QuicheStrCat("Stream id ", max_stream_id + kV99StreamIdIncrement,
- " would exceed stream count limit 100"));
+ max_stream_id + QuicUtils::StreamIdDelta(transport_version()),
+ &error_details));
+ EXPECT_EQ(error_details,
+ quiche::QuicheStrCat(
+ "Stream id ",
+ max_stream_id + QuicUtils::StreamIdDelta(transport_version()),
+ " would exceed stream count limit 100"));
}
TEST_P(QuicStreamIdManagerTest, MaxStreamsWindow) {
@@ -353,7 +355,7 @@
stream_id_manager_.available_incoming_streams());
stream_count--;
- stream_id += kV99StreamIdIncrement;
+ stream_id += QuicUtils::StreamIdDelta(transport_version());
}
// Now close them, still should get no MAX_STREAMS
@@ -366,7 +368,7 @@
while (stream_count) {
stream_id_manager_.OnStreamClosed(stream_id);
stream_count--;
- stream_id += kV99StreamIdIncrement;
+ stream_id += QuicUtils::StreamIdDelta(transport_version());
expected_actual_max++;
EXPECT_EQ(expected_actual_max,
stream_id_manager_.incoming_actual_max_streams());
@@ -435,7 +437,7 @@
stream_id_manager_.MaybeIncreaseLargestPeerStreamId(id, nullptr));
stream_id_manager_.OnStreamClosed(id);
i--;
- id += kV99StreamIdIncrement;
+ id += QuicUtils::StreamIdDelta(transport_version());
}
}