Update StreamIdManagerTest.
StreamIdManager is only used in v99, where crypto stream has been removed. We don't need those adjustment on crypto stream in tests.
gfe-relnote: v99 only, not protected.
PiperOrigin-RevId: 263385887
Change-Id: I5d338b2e3b6c1376da3757aa19174179955e483d
diff --git a/quic/core/quic_stream_id_manager_test.cc b/quic/core/quic_stream_id_manager_test.cc
index bd41e45..8c6766b 100644
--- a/quic/core/quic_stream_id_manager_test.cc
+++ b/quic/core/quic_stream_id_manager_test.cc
@@ -194,18 +194,8 @@
TEST_P(QuicStreamIdManagerTestClient, StreamIdManagerClientInitialization) {
// These fields are inited via the QuicSession constructor to default
// values defined as a constant.
- // If bidi, Crypto stream default created at start up, it is one
- // more stream to account for since initialization is "number of
- // request/responses" & crypto is added in to that, not streams.
- size_t extra_stream_count = 0;
- if (GetParam() && !QuicVersionUsesCryptoFrames(transport_version())) {
- extra_stream_count = 1;
- }
- EXPECT_EQ(kDefaultMaxStreamsPerConnection + extra_stream_count,
+ EXPECT_EQ(kDefaultMaxStreamsPerConnection,
stream_id_manager_->outgoing_max_streams());
- // Test is predicated on having 1 static stream going if bidi, 0 if not...)
- EXPECT_EQ(extra_stream_count,
- stream_id_manager_->outgoing_static_stream_count());
EXPECT_EQ(kDefaultMaxStreamsPerConnection,
stream_id_manager_->incoming_actual_max_streams());
@@ -238,16 +228,8 @@
QuicStreamCount implementation_max =
QuicUtils::GetMaxStreamCount(!GetParam(), /* GetParam==true for bidi */
Perspective::IS_CLIENT);
- stream_id_manager_->AdjustMaxOpenOutgoingStreams(implementation_max - 1u);
- // If bidi, Crypto stream default created at start up, it is one
- // more stream to account for since initialization is "number of
- // request/responses" & crypto is added in to that, not streams.
- size_t extra_stream_count = 0;
- if (GetParam() && !QuicVersionUsesCryptoFrames(transport_version())) {
- extra_stream_count = 1;
- }
- EXPECT_EQ(implementation_max - 1u + extra_stream_count,
- stream_id_manager_->outgoing_max_streams());
+ stream_id_manager_->AdjustMaxOpenOutgoingStreams(implementation_max);
+ EXPECT_EQ(implementation_max, stream_id_manager_->outgoing_max_streams());
stream_id_manager_->AdjustMaxOpenOutgoingStreams(implementation_max);
EXPECT_EQ(implementation_max, stream_id_manager_->outgoing_max_streams());
@@ -395,8 +377,8 @@
QuicMaxStreamsFrame frame;
// Even though the stream count in the frame is < the initial maximum,
- // it is should be ignored since the initial max was set via
- // the constructor (an educated guess) and the MAX STREAMS frame
+ // it shouldn't be ignored since the initial max was set via
+ // the constructor (an educated guess) but the MAX STREAMS frame
// is authoritative.
frame.stream_count = initial_stream_count - 1;
@@ -491,20 +473,12 @@
TEST_P(QuicStreamIdManagerTestClient, StreamIdManagerGetNextOutgoingStream) {
// Number of streams we can open and the first one we should get when
// opening...
- int number_of_streams = kDefaultMaxStreamsPerConnection;
+ size_t number_of_streams = kDefaultMaxStreamsPerConnection;
QuicStreamId stream_id =
IsUnidi() ? session_->next_outgoing_unidirectional_stream_id()
: session_->next_outgoing_bidirectional_stream_id();
- // If bidi, Crypto stream default created at start up, it is one
- // more stream to account for since initialization is "number of
- // request/responses" & crypto is added in to that, not streams.
- size_t extra_stream_count = 0;
- if (IsBidi() && !QuicVersionUsesCryptoFrames(transport_version())) {
- extra_stream_count = 1;
- }
- EXPECT_EQ(number_of_streams + extra_stream_count,
- stream_id_manager_->outgoing_max_streams());
+ EXPECT_EQ(number_of_streams, stream_id_manager_->outgoing_max_streams());
while (number_of_streams) {
EXPECT_TRUE(stream_id_manager_->CanOpenNextOutgoingStream());
EXPECT_EQ(stream_id, stream_id_manager_->GetNextOutgoingStreamId());
@@ -522,7 +496,7 @@
// If bidi, Crypto stream default created at start up, it is one
// more stream to account for since initialization is "number of
// request/responses" & crypto is added in to that, not streams.
- EXPECT_EQ(kDefaultMaxStreamsPerConnection + extra_stream_count,
+ EXPECT_EQ(kDefaultMaxStreamsPerConnection,
session_->save_frame().max_streams_frame.stream_count);
// If we try to get the next id (above the limit), it should cause a quic-bug.
EXPECT_QUIC_BUG(
@@ -787,15 +761,8 @@
// values defined as a constant.
EXPECT_EQ(kDefaultMaxStreamsPerConnection,
stream_id_manager_->incoming_initial_max_open_streams());
- // If bidi, Crypto stream default created at start up, it is one
- // more stream to account for since initialization is "number of
- // request/responses" & crypto is added in to that, not streams.
- // Since this is the server, the stream is incoming.
- size_t extra_stream_count = 0;
- if (IsBidi() && !QuicVersionUsesCryptoFrames(transport_version())) {
- extra_stream_count = 1;
- }
- EXPECT_EQ(kDefaultMaxStreamsPerConnection + extra_stream_count,
+
+ EXPECT_EQ(kDefaultMaxStreamsPerConnection,
stream_id_manager_->incoming_actual_max_streams());
EXPECT_EQ(kDefaultMaxStreamsPerConnection,
stream_id_manager_->outgoing_max_streams());