Internal QUICHE change
PiperOrigin-RevId: 320998541
Change-Id: I8041239170ad3cdaa131317220a7830dd23fc68f
diff --git a/quic/core/http/quic_spdy_client_session_test.cc b/quic/core/http/quic_spdy_client_session_test.cc
index 6f022c1..2500c97 100644
--- a/quic/core/http/quic_spdy_client_session_test.cc
+++ b/quic/core/http/quic_spdy_client_session_test.cc
@@ -226,10 +226,18 @@
test::SimpleSessionCache* client_session_cache_;
};
+std::string ParamNameFormatter(
+ const testing::TestParamInfo<QuicSpdyClientSessionTest::ParamType>& info) {
+ const ParsedQuicVersion& version = info.param;
+ return quiche::QuicheStrCat(
+ QuicVersionToString(version.transport_version), "_",
+ HandshakeProtocolToString(version.handshake_protocol));
+}
+
INSTANTIATE_TEST_SUITE_P(Tests,
QuicSpdyClientSessionTest,
::testing::ValuesIn(AllSupportedVersions()),
- ::testing::PrintToStringParamName());
+ ParamNameFormatter);
TEST_P(QuicSpdyClientSessionTest, CryptoConnect) {
CompleteCryptoHandshake();
@@ -1196,11 +1204,15 @@
if (session_->version().UsesHttp3()) {
// Both control stream and the request stream will report errors.
- EXPECT_CALL(*connection_,
- CloseConnection(QUIC_ZERO_RTT_UNRETRANSMITTABLE, _, _))
- .Times(2)
+ // Open question: should both streams be closed with the same error code?
+ EXPECT_CALL(*connection_, CloseConnection(_, _, _))
.WillOnce(testing::Invoke(connection_,
&MockQuicConnection::ReallyCloseConnection));
+ EXPECT_CALL(*connection_,
+ CloseConnection(QUIC_ZERO_RTT_UNRETRANSMITTABLE, _, _))
+ .WillOnce(testing::Invoke(connection_,
+ &MockQuicConnection::ReallyCloseConnection))
+ .RetiresOnSaturation();
} else {
EXPECT_CALL(*connection_,
CloseConnection(
diff --git a/quic/core/http/quic_spdy_stream_test.cc b/quic/core/http/quic_spdy_stream_test.cc
index e769a9d..63df00e 100644
--- a/quic/core/http/quic_spdy_stream_test.cc
+++ b/quic/core/http/quic_spdy_stream_test.cc
@@ -2142,25 +2142,27 @@
Initialize(kShouldProcessData);
connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1));
- testing::InSequence s;
- EXPECT_CALL(
- *connection_,
- CloseConnection(QUIC_QPACK_DECOMPRESSION_FAILED,
- MatchesRegex("Error decoding headers on stream \\d+: "
- "Invalid relative index."),
- _))
- .WillOnce(
- (Invoke([this](QuicErrorCode error, const std::string& error_details,
- ConnectionCloseBehavior connection_close_behavior) {
- connection_->ReallyCloseConnection(error, error_details,
- connection_close_behavior);
- })));
- EXPECT_CALL(*connection_, SendConnectionClosePacket(_, _));
- EXPECT_CALL(*session_, OnConnectionClosed(_, _))
- .WillOnce(Invoke([this](const QuicConnectionCloseFrame& frame,
- ConnectionCloseSource source) {
- session_->ReallyOnConnectionClosed(frame, source);
- }));
+ {
+ testing::InSequence s;
+ EXPECT_CALL(
+ *connection_,
+ CloseConnection(QUIC_QPACK_DECOMPRESSION_FAILED,
+ MatchesRegex("Error decoding headers on stream \\d+: "
+ "Invalid relative index."),
+ _))
+ .WillOnce((
+ Invoke([this](QuicErrorCode error, const std::string& error_details,
+ ConnectionCloseBehavior connection_close_behavior) {
+ connection_->ReallyCloseConnection(error, error_details,
+ connection_close_behavior);
+ })));
+ EXPECT_CALL(*connection_, SendConnectionClosePacket(_, _));
+ EXPECT_CALL(*session_, OnConnectionClosed(_, _))
+ .WillOnce(Invoke([this](const QuicConnectionCloseFrame& frame,
+ ConnectionCloseSource source) {
+ session_->ReallyOnConnectionClosed(frame, source);
+ }));
+ }
EXPECT_CALL(*session_, SendRstStream(stream_->id(), _, _));
EXPECT_CALL(*session_, SendRstStream(stream2_->id(), _, _));
diff --git a/quic/core/quic_session.h b/quic/core/quic_session.h
index 706eb64..54a1426 100644
--- a/quic/core/quic_session.h
+++ b/quic/core/quic_session.h
@@ -486,15 +486,15 @@
}
protected:
- using StreamMap = QuicSmallMap<QuicStreamId, std::unique_ptr<QuicStream>, 10>;
+ using StreamMap = QuicHashMap<QuicStreamId, std::unique_ptr<QuicStream>>;
using PendingStreamMap =
- QuicSmallMap<QuicStreamId, std::unique_ptr<PendingStream>, 10>;
+ QuicHashMap<QuicStreamId, std::unique_ptr<PendingStream>>;
using ClosedStreams = std::vector<std::unique_ptr<QuicStream>>;
using ZombieStreamMap =
- QuicSmallMap<QuicStreamId, std::unique_ptr<QuicStream>, 10>;
+ QuicHashMap<QuicStreamId, std::unique_ptr<QuicStream>>;
// Creates a new stream to handle a peer-initiated stream.
// Caller does not own the returned stream.