OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/quic/quic_unacked_packet_map.h" | 5 #include "net/quic/quic_unacked_packet_map.h" |
6 | 6 |
7 #include "net/quic/test_tools/quic_test_utils.h" | 7 #include "net/quic/test_tools/quic_test_utils.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace net { | 10 namespace net { |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 unacked_packets_.RemoveRetransmittability(6); | 227 unacked_packets_.RemoveRetransmittability(6); |
228 unacked_packets_.OnRetransmittedPacket(5, 7, LOSS_RETRANSMISSION); | 228 unacked_packets_.OnRetransmittedPacket(5, 7, LOSS_RETRANSMISSION); |
229 unacked_packets_.SetSent(7, now_, kDefaultLength, true); | 229 unacked_packets_.SetSent(7, now_, kDefaultLength, true); |
230 | 230 |
231 QuicPacketSequenceNumber unacked4[] = { 3, 5, 7 }; | 231 QuicPacketSequenceNumber unacked4[] = { 3, 5, 7 }; |
232 VerifyUnackedPackets(unacked4, arraysize(unacked4)); | 232 VerifyUnackedPackets(unacked4, arraysize(unacked4)); |
233 QuicPacketSequenceNumber pending4[] = { 3, 5, 7 }; | 233 QuicPacketSequenceNumber pending4[] = { 3, 5, 7 }; |
234 VerifyInFlightPackets(pending4, arraysize(pending4)); | 234 VerifyInFlightPackets(pending4, arraysize(pending4)); |
235 QuicPacketSequenceNumber retransmittable4[] = { 7 }; | 235 QuicPacketSequenceNumber retransmittable4[] = { 7 }; |
236 VerifyRetransmittablePackets(retransmittable4, arraysize(retransmittable4)); | 236 VerifyRetransmittablePackets(retransmittable4, arraysize(retransmittable4)); |
| 237 |
| 238 // Remove the older two transmissions from in flight. |
| 239 unacked_packets_.RemoveFromInFlight(3); |
| 240 unacked_packets_.RemoveFromInFlight(5); |
| 241 QuicPacketSequenceNumber pending5[] = { 7 }; |
| 242 VerifyInFlightPackets(pending5, arraysize(pending5)); |
| 243 |
| 244 // Now test ClearPreviousTransmissions. |
| 245 unacked_packets_.ClearPreviousRetransmissions(5); |
| 246 QuicPacketSequenceNumber unacked5[] = { 7 }; |
| 247 VerifyUnackedPackets(unacked5, arraysize(unacked5)); |
| 248 QuicPacketSequenceNumber retransmittable5[] = { 7 }; |
| 249 VerifyRetransmittablePackets(retransmittable5, arraysize(retransmittable5)); |
237 } | 250 } |
238 | 251 |
239 } // namespace | 252 } // namespace |
240 } // namespace test | 253 } // namespace test |
241 } // namespace net | 254 } // namespace net |
OLD | NEW |