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

Side by Side Diff: net/quic/quic_unacked_packet_map_test.cc

Issue 554993002: Fix a crash bug in QuicUnackedPacketMap when truncated acks arrived. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@send_an_ack_74741188
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 unified diff | Download patch
« no previous file with comments | « net/quic/quic_unacked_packet_map.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « net/quic/quic_unacked_packet_map.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698