Index: net/quic/quic_connection_test.cc |
diff --git a/net/quic/quic_connection_test.cc b/net/quic/quic_connection_test.cc |
index 5f253ac396ecb2fa9a7d73ad6d10a0656db04416..760ef02c90927d3e383a5ff488d0e2f8f6651027 100644 |
--- a/net/quic/quic_connection_test.cc |
+++ b/net/quic/quic_connection_test.cc |
@@ -4963,6 +4963,43 @@ TEST_P(QuicConnectionTest, MultipleCallsToCloseConnection) { |
ConnectionCloseBehavior::SILENT_CLOSE); |
} |
+TEST_P(QuicConnectionTest, ServerReceivesChloOnNonCryptoStream) { |
+ FLAGS_quic_detect_memory_corrpution = true; |
+ EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); |
+ |
+ set_perspective(Perspective::IS_SERVER); |
+ QuicPacketCreatorPeer::SetSendVersionInPacket(creator_, false); |
+ |
+ CryptoHandshakeMessage message; |
+ CryptoFramer framer; |
+ message.set_tag(kCHLO); |
+ std::unique_ptr<QuicData> data(framer.ConstructHandshakeMessage(message)); |
+ frame1_.stream_id = 10; |
+ frame1_.data_buffer = data->data(); |
+ frame1_.data_length = data->length(); |
+ |
+ EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_MAYBE_CORRUPTED_MEMORY, _, |
+ ConnectionCloseSource::FROM_SELF)); |
+ ProcessFramePacket(QuicFrame(&frame1_)); |
+} |
+ |
+TEST_P(QuicConnectionTest, ClientReceivesRejOnNonCryptoStream) { |
+ FLAGS_quic_detect_memory_corrpution = true; |
+ EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); |
+ |
+ CryptoHandshakeMessage message; |
+ CryptoFramer framer; |
+ message.set_tag(kREJ); |
+ std::unique_ptr<QuicData> data(framer.ConstructHandshakeMessage(message)); |
+ frame1_.stream_id = 10; |
+ frame1_.data_buffer = data->data(); |
+ frame1_.data_length = data->length(); |
+ |
+ EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_MAYBE_CORRUPTED_MEMORY, _, |
+ ConnectionCloseSource::FROM_SELF)); |
+ ProcessFramePacket(QuicFrame(&frame1_)); |
+} |
+ |
} // namespace |
} // namespace test |
} // namespace net |