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

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

Issue 158073007: Fix bug in QuicSentPacketManager::ClearPreviousRetransmissions where (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_sent_packet_manager.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_sent_packet_manager.h" 5 #include "net/quic/quic_sent_packet_manager.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "net/quic/test_tools/quic_sent_packet_manager_peer.h" 8 #include "net/quic/test_tools/quic_sent_packet_manager_peer.h"
9 #include "net/quic/test_tools/quic_test_utils.h" 9 #include "net/quic/test_tools/quic_test_utils.h"
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 // Truncated ack with 4 NACKs 503 // Truncated ack with 4 NACKs
504 { 504 {
505 ReceivedPacketInfo received_info; 505 ReceivedPacketInfo received_info;
506 received_info.largest_observed = 6; 506 received_info.largest_observed = 6;
507 received_info.missing_packets.insert(3); 507 received_info.missing_packets.insert(3);
508 received_info.missing_packets.insert(4); 508 received_info.missing_packets.insert(4);
509 received_info.missing_packets.insert(5); 509 received_info.missing_packets.insert(5);
510 received_info.missing_packets.insert(6); 510 received_info.missing_packets.insert(6);
511 received_info.is_truncated = true; 511 received_info.is_truncated = true;
512 EXPECT_CALL(*send_algorithm_, OnPacketAcked(1, _)); 512 EXPECT_CALL(*send_algorithm_, OnPacketAcked(1, _));
513 EXPECT_CALL(*send_algorithm_, OnPacketLost(3, _));
513 EXPECT_CALL(*send_algorithm_, OnPacketAbandoned(3, _)); 514 EXPECT_CALL(*send_algorithm_, OnPacketAbandoned(3, _));
514 EXPECT_CALL(*send_algorithm_, OnPacketAbandoned(4, _));
515 manager_.OnIncomingAck(received_info, QuicTime::Zero()); 515 manager_.OnIncomingAck(received_info, QuicTime::Zero());
516 } 516 }
517 517
518 // High water mark will be raised. 518 // High water mark will be raised.
519 QuicPacketSequenceNumber unacked[] = { 5, 6, 7, 8, 9 }; 519 QuicPacketSequenceNumber unacked[] = { 4, 5, 6, 7, 8, 9 };
520 VerifyUnackedPackets(unacked, arraysize(unacked)); 520 VerifyUnackedPackets(unacked, arraysize(unacked));
521 QuicPacketSequenceNumber retransmittable[] = { 5, 6, 7, 8, 9 }; 521 QuicPacketSequenceNumber retransmittable[] = { 5, 6, 7, 8, 9 };
522 VerifyRetransmittablePackets(retransmittable, arraysize(retransmittable)); 522 VerifyRetransmittablePackets(retransmittable, arraysize(retransmittable));
523 } 523 }
524 524
525 TEST_F(QuicSentPacketManagerTest, GetLeastUnackedSentPacket) { 525 TEST_F(QuicSentPacketManagerTest, GetLeastUnackedSentPacket) {
526 EXPECT_EQ(0u, manager_.GetLeastUnackedSentPacket()); 526 EXPECT_EQ(0u, manager_.GetLeastUnackedSentPacket());
527 } 527 }
528 528
529 TEST_F(QuicSentPacketManagerTest, GetLeastUnackedSentPacketUnacked) { 529 TEST_F(QuicSentPacketManagerTest, GetLeastUnackedSentPacketUnacked) {
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
1267 delay = delay.Add(delay); 1267 delay = delay.Add(delay);
1268 EXPECT_CALL(*send_algorithm_, OnRetransmissionTimeout(true)); 1268 EXPECT_CALL(*send_algorithm_, OnRetransmissionTimeout(true));
1269 manager_.OnRetransmissionTimeout(); 1269 manager_.OnRetransmissionTimeout();
1270 RetransmitNextPacket(i + 2); 1270 RetransmitNextPacket(i + 2);
1271 } 1271 }
1272 } 1272 }
1273 1273
1274 } // namespace 1274 } // namespace
1275 } // namespace test 1275 } // namespace test
1276 } // namespace net 1276 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_sent_packet_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698