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

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

Issue 1431693002: Change QuicAckFrame's revived_packets to be a single QuicPacketNumber. QUIC now ignores all but the… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@106724344
Patch Set: Created 5 years, 1 month 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_received_packet_manager.cc ('k') | net/quic/quic_sent_packet_manager.cc » ('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 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
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
OLDNEW
« no previous file with comments | « net/quic/quic_received_packet_manager.cc ('k') | net/quic/quic_sent_packet_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698