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

Side by Side 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 unified diff | 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 »
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 using std::min; 10 using std::min;
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 EXPECT_EQ(kDefaultLength, unacked_packets_.bytes_in_flight()); 280 EXPECT_EQ(kDefaultLength, unacked_packets_.bytes_in_flight());
281 281
282 // Simulate an F-RTO, and restore 1 to flight. 282 // Simulate an F-RTO, and restore 1 to flight.
283 unacked_packets_.RestoreInFlight(1); 283 unacked_packets_.RestoreInFlight(1);
284 VerifyUnackedPackets(unacked, arraysize(unacked)); 284 VerifyUnackedPackets(unacked, arraysize(unacked));
285 VerifyInFlightPackets(unacked, arraysize(unacked)); 285 VerifyInFlightPackets(unacked, arraysize(unacked));
286 VerifyRetransmittablePackets(retransmittable, arraysize(retransmittable)); 286 VerifyRetransmittablePackets(retransmittable, arraysize(retransmittable));
287 EXPECT_EQ(2 * kDefaultLength, unacked_packets_.bytes_in_flight()); 287 EXPECT_EQ(2 * kDefaultLength, unacked_packets_.bytes_in_flight());
288 } 288 }
289 289
290 TEST_F(QuicUnackedPacketMapTest, SendWithGap) {
291 // Simulate a retransmittable packet being sent, retransmitted, and the first
292 // transmission being acked.
293 unacked_packets_.AddPacket(CreateRetransmittablePacket(1));
294 unacked_packets_.SetSent(1, now_, kDefaultLength, true);
295 unacked_packets_.AddPacket(CreateRetransmittablePacket(3));
296 unacked_packets_.SetSent(3, now_, kDefaultLength, true);
297 unacked_packets_.OnRetransmittedPacket(1, 5, LOSS_RETRANSMISSION);
298 unacked_packets_.SetSent(5, now_, kDefaultLength, true);
299
300 EXPECT_EQ(1u, unacked_packets_.GetLeastUnacked());
301 EXPECT_TRUE(unacked_packets_.IsUnacked(1));
302 EXPECT_FALSE(unacked_packets_.IsUnacked(2));
303 EXPECT_TRUE(unacked_packets_.IsUnacked(3));
304 EXPECT_FALSE(unacked_packets_.IsUnacked(4));
305 EXPECT_TRUE(unacked_packets_.IsUnacked(5));
306 EXPECT_EQ(5u, unacked_packets_.largest_sent_packet());
307 }
308
309
290 } // namespace 310 } // namespace
291 } // namespace test 311 } // namespace test
292 } // namespace net 312 } // namespace net
OLDNEW
« 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