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

Unified Diff: net/quic/quic_unacked_packet_map_test.cc

Issue 566743003: Call QuicSentPacketManager's OnPacketSerialized or OnRetransmittedPacket (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@initializing_next_stream_id_75335114
Patch Set: Created 6 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/quic_unacked_packet_map.cc ('k') | net/quic/test_tools/quic_test_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_unacked_packet_map_test.cc
diff --git a/net/quic/quic_unacked_packet_map_test.cc b/net/quic/quic_unacked_packet_map_test.cc
index 1b084c13d435b9dd26f4b0c0b4f3299f76e8c659..0d40f4afee657b38c4eee6d4909fe078eeac28d8 100644
--- a/net/quic/quic_unacked_packet_map_test.cc
+++ b/net/quic/quic_unacked_packet_map_test.cc
@@ -287,6 +287,26 @@ TEST_F(QuicUnackedPacketMapTest, RestoreInflight) {
EXPECT_EQ(2 * kDefaultLength, unacked_packets_.bytes_in_flight());
}
+TEST_F(QuicUnackedPacketMapTest, SendWithGap) {
+ // Simulate a retransmittable packet being sent, retransmitted, and the first
+ // transmission being acked.
+ unacked_packets_.AddPacket(CreateRetransmittablePacket(1));
+ unacked_packets_.SetSent(1, now_, kDefaultLength, true);
+ unacked_packets_.AddPacket(CreateRetransmittablePacket(3));
+ unacked_packets_.SetSent(3, now_, kDefaultLength, true);
+ unacked_packets_.OnRetransmittedPacket(1, 5, LOSS_RETRANSMISSION);
+ unacked_packets_.SetSent(5, now_, kDefaultLength, true);
+
+ EXPECT_EQ(1u, unacked_packets_.GetLeastUnacked());
+ EXPECT_TRUE(unacked_packets_.IsUnacked(1));
+ EXPECT_FALSE(unacked_packets_.IsUnacked(2));
+ EXPECT_TRUE(unacked_packets_.IsUnacked(3));
+ EXPECT_FALSE(unacked_packets_.IsUnacked(4));
+ EXPECT_TRUE(unacked_packets_.IsUnacked(5));
+ EXPECT_EQ(5u, unacked_packets_.largest_sent_packet());
+}
+
+
} // namespace
} // namespace test
} // namespace net
« no previous file with comments | « net/quic/quic_unacked_packet_map.cc ('k') | net/quic/test_tools/quic_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698