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

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

Issue 2359503003: Landing Recent QUIC changes until 9:58 AM, Sep 17, 2016 UTC (Closed)
Patch Set: Reverted flag flip. 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') | net/quic/core/quic_sent_packet_manager_test.cc » ('j') | 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 4e16edcdb224bf934df69006e66fbeacff80d2f5..782d28ea26a2e8e4094d3c27743f7a57eb60b4b7 100644
--- a/net/quic/core/quic_packet_generator_test.cc
+++ b/net/quic/core/quic_packet_generator_test.cc
@@ -452,7 +452,7 @@ TEST_F(QuicPacketGeneratorTest, ConsumeData_FramesPreviouslyQueued) {
GetPacketHeaderSize(
framer_.version(), creator_->connection_id_length(), kIncludeVersion,
!kIncludePathId, !kIncludeDiversificationNonce,
- QuicPacketCreatorPeer::NextPacketNumberLength(creator_)) +
+ QuicPacketCreatorPeer::GetPacketNumberLength(creator_)) +
// Add an extra 3 bytes for the payload and 1 byte so BytesFree is larger
// than the GetMinStreamFrameSize.
QuicFramer::GetMinStreamFrameSize(1, 0, false) + 3 +
@@ -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') | net/quic/core/quic_sent_packet_manager_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698