Index: net/quic/core/quic_session_test.cc |
diff --git a/net/quic/core/quic_session_test.cc b/net/quic/core/quic_session_test.cc |
index 8f241cfc38e453a5786033e95e301507d1a33c42..3d4f12c9d5eb58906e615acc4b8b31c77495e0c9 100644 |
--- a/net/quic/core/quic_session_test.cc |
+++ b/net/quic/core/quic_session_test.cc |
@@ -125,7 +125,13 @@ class TestSession : public QuicSpdySession { |
~TestSession() override { delete connection(); } |
- TestCryptoStream* GetCryptoStream() override { return &crypto_stream_; } |
+ TestCryptoStream* GetMutableCryptoStream() override { |
+ return &crypto_stream_; |
+ } |
+ |
+ const TestCryptoStream* GetCryptoStream() const override { |
+ return &crypto_stream_; |
+ } |
TestStream* CreateOutgoingDynamicStream(SpdyPriority priority) override { |
TestStream* stream = new TestStream(GetNextOutgoingStreamId(), this); |
@@ -304,7 +310,7 @@ TEST_P(QuicSessionTestServer, PeerAddress) { |
TEST_P(QuicSessionTestServer, IsCryptoHandshakeConfirmed) { |
EXPECT_FALSE(session_.IsCryptoHandshakeConfirmed()); |
CryptoHandshakeMessage message; |
- session_.GetCryptoStream()->OnHandshakeMessage(message); |
+ session_.GetMutableCryptoStream()->OnHandshakeMessage(message); |
EXPECT_TRUE(session_.IsCryptoHandshakeConfirmed()); |
} |
@@ -525,7 +531,7 @@ TEST_P(QuicSessionTestServer, OnCanWriteBundlesStreams) { |
EXPECT_CALL(*writer, WritePacket(_, _, _, _, _)) |
.WillOnce(Return(WriteResult(WRITE_STATUS_OK, 0))); |
} |
- session_.GetCryptoStream()->OnHandshakeMessage(msg); |
+ session_.GetMutableCryptoStream()->OnHandshakeMessage(msg); |
// Drive congestion control manually. |
MockSendAlgorithm* send_algorithm = new StrictMock<MockSendAlgorithm>; |
@@ -680,7 +686,7 @@ TEST_P(QuicSessionTestServer, BufferedHandshake) { |
// Due to prioritization, we *should* be asked to write the crypto stream |
// first. |
// Don't re-register the crypto stream (which signals complete writing). |
- TestCryptoStream* crypto_stream = session_.GetCryptoStream(); |
+ TestCryptoStream* crypto_stream = session_.GetMutableCryptoStream(); |
EXPECT_CALL(*crypto_stream, OnCanWrite()); |
EXPECT_CALL(*stream2, OnCanWrite()) |
@@ -754,7 +760,7 @@ TEST_P(QuicSessionTestServer, OnCanWriteLimitsNumWritesIfFlowControlBlocked) { |
// The crypto and headers streams should be called even though we are |
// connection flow control blocked. |
- TestCryptoStream* crypto_stream = session_.GetCryptoStream(); |
+ TestCryptoStream* crypto_stream = session_.GetMutableCryptoStream(); |
EXPECT_CALL(*crypto_stream, OnCanWrite()); |
TestHeadersStream* headers_stream = new TestHeadersStream(&session_); |
QuicSpdySessionPeer::SetHeadersStream(&session_, headers_stream); |
@@ -789,7 +795,7 @@ TEST_P(QuicSessionTestServer, IncreasedTimeoutAfterCryptoHandshake) { |
EXPECT_EQ(kInitialIdleTimeoutSecs + 3, |
QuicConnectionPeer::GetNetworkTimeout(connection_).ToSeconds()); |
CryptoHandshakeMessage msg; |
- session_.GetCryptoStream()->OnHandshakeMessage(msg); |
+ session_.GetMutableCryptoStream()->OnHandshakeMessage(msg); |
EXPECT_EQ(kMaximumIdleTimeoutSecs + 3, |
QuicConnectionPeer::GetNetworkTimeout(connection_).ToSeconds()); |
} |
@@ -836,7 +842,7 @@ TEST_P(QuicSessionTestServer, HandshakeUnblocksFlowControlBlockedStream) { |
// Now complete the crypto handshake, resulting in an increased flow control |
// send window. |
CryptoHandshakeMessage msg; |
- session_.GetCryptoStream()->OnHandshakeMessage(msg); |
+ session_.GetMutableCryptoStream()->OnHandshakeMessage(msg); |
// Stream is now unblocked. |
EXPECT_FALSE(stream2->flow_controller()->IsBlocked()); |
@@ -848,7 +854,7 @@ TEST_P(QuicSessionTestServer, HandshakeUnblocksFlowControlBlockedCryptoStream) { |
// Test that if the crypto stream is flow control blocked, then if the SHLO |
// contains a larger send window offset, the stream becomes unblocked. |
session_.set_writev_consumes_all_data(true); |
- TestCryptoStream* crypto_stream = session_.GetCryptoStream(); |
+ TestCryptoStream* crypto_stream = session_.GetMutableCryptoStream(); |
EXPECT_FALSE(crypto_stream->flow_controller()->IsBlocked()); |
EXPECT_FALSE(session_.IsConnectionFlowControlBlocked()); |
EXPECT_FALSE(session_.IsStreamFlowControlBlocked()); |
@@ -881,7 +887,7 @@ TEST_P(QuicSessionTestServer, HandshakeUnblocksFlowControlBlockedCryptoStream) { |
// Now complete the crypto handshake, resulting in an increased flow control |
// send window. |
CryptoHandshakeMessage msg; |
- session_.GetCryptoStream()->OnHandshakeMessage(msg); |
+ session_.GetMutableCryptoStream()->OnHandshakeMessage(msg); |
// Stream is now unblocked and will no longer have buffered data. |
EXPECT_FALSE(crypto_stream->flow_controller()->IsBlocked()); |
@@ -900,7 +906,7 @@ TEST_P(QuicSessionTestServer, |
// Test that if the header stream is flow control blocked, then if the SHLO |
// contains a larger send window offset, the stream becomes unblocked. |
session_.set_writev_consumes_all_data(true); |
- TestCryptoStream* crypto_stream = session_.GetCryptoStream(); |
+ TestCryptoStream* crypto_stream = session_.GetMutableCryptoStream(); |
EXPECT_FALSE(crypto_stream->flow_controller()->IsBlocked()); |
EXPECT_FALSE(session_.IsConnectionFlowControlBlocked()); |
EXPECT_FALSE(session_.IsStreamFlowControlBlocked()); |
@@ -935,7 +941,7 @@ TEST_P(QuicSessionTestServer, |
// Now complete the crypto handshake, resulting in an increased flow control |
// send window. |
CryptoHandshakeMessage msg; |
- session_.GetCryptoStream()->OnHandshakeMessage(msg); |
+ session_.GetMutableCryptoStream()->OnHandshakeMessage(msg); |
// Stream is now unblocked and will no longer have buffered data. |
EXPECT_FALSE(headers_stream->flow_controller()->IsBlocked()); |