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

Unified Diff: net/quic/quic_unacked_packet_map_test.cc

Issue 420313005: Land Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_0723
Patch Set: change QUIC packet size to 1350 Created 6 years, 5 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
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 87c6ca818fbb0afe77a54935deb6b4ed124e553e..6e680de456878097f2ebdd2c7025864c3b9fab83 100644
--- a/net/quic/quic_unacked_packet_map_test.cc
+++ b/net/quic/quic_unacked_packet_map_test.cc
@@ -177,7 +177,7 @@ TEST_F(QuicUnackedPacketMapTest, RetransmittedPacket) {
VerifyRetransmittablePackets(NULL, 0);
}
-TEST_F(QuicUnackedPacketMapTest, RetransmitTwice) {
+TEST_F(QuicUnackedPacketMapTest, RetransmitThreeTimes) {
// Simulate a retransmittable packet being sent and retransmitted twice.
unacked_packets_.AddPacket(CreateRetransmittablePacket(1));
unacked_packets_.SetSent(1, now_, kDefaultLength, true);
@@ -211,16 +211,31 @@ TEST_F(QuicUnackedPacketMapTest, RetransmitTwice) {
unacked_packets_.IncreaseLargestObserved(4);
unacked_packets_.RemoveFromInFlight(4);
unacked_packets_.RemoveRetransmittability(4);
- unacked_packets_.RemoveFromInFlight(3);
unacked_packets_.OnRetransmittedPacket(3, 5, LOSS_RETRANSMISSION);
unacked_packets_.SetSent(5, now_, kDefaultLength, true);
+ unacked_packets_.AddPacket(CreateRetransmittablePacket(6));
+ unacked_packets_.SetSent(6, now_, kDefaultLength, true);
- QuicPacketSequenceNumber unacked3[] = { 3, 5 };
+ QuicPacketSequenceNumber unacked3[] = { 3, 5, 6 };
VerifyUnackedPackets(unacked3, arraysize(unacked3));
- QuicPacketSequenceNumber pending3[] = { 5 };
+ QuicPacketSequenceNumber pending3[] = { 3, 5, 6 };
VerifyInFlightPackets(pending3, arraysize(pending3));
- QuicPacketSequenceNumber retransmittable3[] = { 5 };
+ QuicPacketSequenceNumber retransmittable3[] = { 5, 6 };
VerifyRetransmittablePackets(retransmittable3, arraysize(retransmittable3));
+
+ // Early retransmit 5 as 7 and ensure in flight packet 3 is not removed.
+ unacked_packets_.IncreaseLargestObserved(6);
+ unacked_packets_.RemoveFromInFlight(6);
+ unacked_packets_.RemoveRetransmittability(6);
+ unacked_packets_.OnRetransmittedPacket(5, 7, LOSS_RETRANSMISSION);
+ unacked_packets_.SetSent(7, now_, kDefaultLength, true);
+
+ QuicPacketSequenceNumber unacked4[] = { 3, 5, 7 };
+ VerifyUnackedPackets(unacked4, arraysize(unacked4));
+ QuicPacketSequenceNumber pending4[] = { 3, 5, 7 };
+ VerifyInFlightPackets(pending4, arraysize(pending4));
+ QuicPacketSequenceNumber retransmittable4[] = { 7 };
+ VerifyRetransmittablePackets(retransmittable4, arraysize(retransmittable4));
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698