OLD | NEW |
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_received_packet_manager.h" | 5 #include "net/quic/quic_received_packet_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "net/quic/quic_connection_stats.h" | 10 #include "net/quic/quic_connection_stats.h" |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 | 348 |
349 TEST_F(QuicReceivedPacketManagerTest, RevivedPacket) { | 349 TEST_F(QuicReceivedPacketManagerTest, RevivedPacket) { |
350 RecordPacketReceipt(1, 0); | 350 RecordPacketReceipt(1, 0); |
351 RecordPacketReceipt(3, 0); | 351 RecordPacketReceipt(3, 0); |
352 RecordPacketRevived(2); | 352 RecordPacketRevived(2); |
353 | 353 |
354 QuicAckFrame ack; | 354 QuicAckFrame ack; |
355 received_manager_.UpdateReceivedPacketInfo(&ack, QuicTime::Zero()); | 355 received_manager_.UpdateReceivedPacketInfo(&ack, QuicTime::Zero()); |
356 EXPECT_EQ(1u, ack.missing_packets.NumPacketsSlow()); | 356 EXPECT_EQ(1u, ack.missing_packets.NumPacketsSlow()); |
357 EXPECT_EQ(2u, ack.missing_packets.Min()); | 357 EXPECT_EQ(2u, ack.missing_packets.Min()); |
358 EXPECT_EQ(1u, ack.revived_packets.size()); | 358 EXPECT_EQ(2u, ack.latest_revived_packet); |
359 EXPECT_EQ(2u, *ack.revived_packets.begin()); | |
360 } | 359 } |
361 | 360 |
362 TEST_F(QuicReceivedPacketManagerTest, PacketRevivedThenReceived) { | 361 TEST_F(QuicReceivedPacketManagerTest, PacketRevivedThenReceived) { |
363 RecordPacketReceipt(1, 0); | 362 RecordPacketReceipt(1, 0); |
364 RecordPacketReceipt(3, 0); | 363 RecordPacketReceipt(3, 0); |
365 RecordPacketRevived(2); | 364 RecordPacketRevived(2); |
366 RecordPacketReceipt(2, 0); | 365 RecordPacketReceipt(2, 0); |
367 | 366 |
368 QuicAckFrame ack; | 367 QuicAckFrame ack; |
369 received_manager_.UpdateReceivedPacketInfo(&ack, QuicTime::Zero()); | 368 received_manager_.UpdateReceivedPacketInfo(&ack, QuicTime::Zero()); |
370 EXPECT_TRUE(ack.missing_packets.Empty()); | 369 EXPECT_TRUE(ack.missing_packets.Empty()); |
371 EXPECT_TRUE(ack.revived_packets.empty()); | 370 EXPECT_EQ(0u, ack.latest_revived_packet); |
372 } | 371 } |
373 | 372 |
374 | 373 |
375 } // namespace | 374 } // namespace |
376 } // namespace test | 375 } // namespace test |
377 } // namespace net | 376 } // namespace net |
OLD | NEW |