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

Unified Diff: net/quic/quic_packet_generator_test.cc

Issue 1777423002: Remove max_packet_length from QuicPacketGenerator, because it is no longer necessary with FEC gone.… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@116277228
Patch Set: Created 4 years, 9 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/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/quic_packet_generator_test.cc
diff --git a/net/quic/quic_packet_generator_test.cc b/net/quic/quic_packet_generator_test.cc
index 4d34725bfb538ce37adb6ab8d22cfbf2b302d8ce..133dad576da261f920b825dc9298553100629feb 100644
--- a/net/quic/quic_packet_generator_test.cc
+++ b/net/quic/quic_packet_generator_test.cc
@@ -390,7 +390,7 @@ TEST_F(QuicPacketGeneratorTest, ConsumeData_Handshake) {
CheckPacketContains(contents, 0);
ASSERT_EQ(1u, packets_.size());
- ASSERT_EQ(kDefaultMaxPacketSize, generator_.GetMaxPacketLength());
+ ASSERT_EQ(kDefaultMaxPacketSize, generator_.GetCurrentMaxPacketLength());
EXPECT_EQ(kDefaultMaxPacketSize, packets_[0].encrypted_length);
}
@@ -668,60 +668,6 @@ TEST_F(QuicPacketGeneratorTest, SetMaxPacketLength_Middle) {
CheckAllPacketsHaveSingleStreamFrame();
}
-// Test whether SetMaxPacketLength() works correctly when we change the packet
-// size in the middle of the batched packet.
-TEST_F(QuicPacketGeneratorTest, SetMaxPacketLength_Midpacket) {
- delegate_.SetCanWriteAnything();
- generator_.StartBatchOperations();
-
- size_t first_write_len = kDefaultMaxPacketSize / 2;
- size_t second_write_len = kDefaultMaxPacketSize;
- size_t packet_len = kDefaultMaxPacketSize + 100;
- ASSERT_LE(packet_len, kMaxPacketSize);
-
- // First send half of the packet worth of data. We are in the batch mode, so
- // should not cause packet serialization.
- QuicConsumedData consumed =
- generator_.ConsumeData(kHeadersStreamId, CreateData(first_write_len),
- /*offset=*/2,
- /*fin=*/false, nullptr);
- EXPECT_EQ(first_write_len, consumed.bytes_consumed);
- EXPECT_FALSE(consumed.fin_consumed);
- EXPECT_TRUE(generator_.HasQueuedFrames());
-
- // Make sure we have no packets so far.
- ASSERT_EQ(0u, packets_.size());
-
- // Increase packet size. Ensure it's not immediately enacted.
- generator_.SetMaxPacketLength(packet_len);
- EXPECT_EQ(packet_len, generator_.GetMaxPacketLength());
- EXPECT_EQ(kDefaultMaxPacketSize, generator_.GetCurrentMaxPacketLength());
-
- // We expect to see exactly one packet serialized after that, since we are in
- // batch mode and we have sent approximately 3/2 of our MTU.
- EXPECT_CALL(delegate_, OnSerializedPacket(_))
- .WillOnce(Invoke(this, &QuicPacketGeneratorTest::SavePacket));
-
- // Send a packet worth of data to the same stream. This should trigger
- // serialization of other packet.
- consumed =
- generator_.ConsumeData(kHeadersStreamId, CreateData(second_write_len),
- /*offset=*/2 + first_write_len,
- /*fin=*/true, nullptr);
- EXPECT_EQ(second_write_len, consumed.bytes_consumed);
- EXPECT_TRUE(consumed.fin_consumed);
- EXPECT_TRUE(generator_.HasQueuedFrames());
-
- // We expect the first packet to contain two frames, and to not reflect the
- // packet size change.
- ASSERT_EQ(1u, packets_.size());
- EXPECT_EQ(kDefaultMaxPacketSize, packets_[0].encrypted_length);
-
- PacketContents contents;
- contents.num_stream_frames = 2;
- CheckPacketContains(contents, 0);
-}
-
// Test whether SetMaxPacketLength() works correctly when we force the change of
// the packet size in the middle of the batched packet.
TEST_F(QuicPacketGeneratorTest, SetMaxPacketLength_MidpacketFlush) {
@@ -754,7 +700,6 @@ TEST_F(QuicPacketGeneratorTest, SetMaxPacketLength_MidpacketFlush) {
// Ensure it's immediately enacted.
generator_.FlushAllQueuedFrames();
generator_.SetMaxPacketLength(packet_len);
- EXPECT_EQ(packet_len, generator_.GetMaxPacketLength());
EXPECT_EQ(packet_len, generator_.GetCurrentMaxPacketLength());
EXPECT_FALSE(generator_.HasQueuedFrames());
« no previous file with comments | « net/quic/quic_packet_generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698