Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Unified Diff: net/quic/core/quic_packet_generator_test.cc

Issue 2351303003: Close connection when packet generator is trying to add a frame which (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/core/quic_packet_generator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_packet_generator_test.cc
diff --git a/net/quic/core/quic_packet_generator_test.cc b/net/quic/core/quic_packet_generator_test.cc
index 264b52a359021cb30d489c9e77e6441e47cff6d9..782d28ea26a2e8e4094d3c27743f7a57eb60b4b7 100644
--- a/net/quic/core/quic_packet_generator_test.cc
+++ b/net/quic/core/quic_packet_generator_test.cc
@@ -877,5 +877,21 @@ TEST_F(QuicPacketGeneratorTest, SetCurrentPath) {
EXPECT_EQ(kTestPathId1, QuicPacketCreatorPeer::GetCurrentPath(creator_));
}
+// Regression test for b/31486443.
+TEST_F(QuicPacketGeneratorTest, ConnectionCloseFrameLargerThanPacketSize) {
+ FLAGS_quic_close_connection_on_huge_frames = true;
+ delegate_.SetCanWriteAnything();
+ QuicConnectionCloseFrame* frame = new QuicConnectionCloseFrame();
+ frame->error_code = QUIC_PACKET_WRITE_ERROR;
+ char buf[2000];
+ StringPiece error_details(buf, 2000);
+ frame->error_details = error_details.as_string();
+ EXPECT_CALL(delegate_,
+ OnUnrecoverableError(QUIC_FAILED_TO_SERIALIZE_PACKET,
+ "Single frame cannot fit into a packet", _));
+ EXPECT_QUIC_BUG(generator_.AddControlFrame(QuicFrame(frame)), "");
+ EXPECT_TRUE(generator_.HasQueuedFrames());
+}
+
} // namespace test
} // namespace net
« no previous file with comments | « net/quic/core/quic_packet_generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698