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

Unified Diff: net/quic/quic_unacked_packet_map_test.cc

Issue 515303003: Landing Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bug fix for 409191 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_unacked_packet_map.cc ('k') | net/quic/test_tools/quic_sent_packet_manager_peer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_unacked_packet_map_test.cc
diff --git a/net/quic/quic_unacked_packet_map_test.cc b/net/quic/quic_unacked_packet_map_test.cc
index 6e680de456878097f2ebdd2c7025864c3b9fab83..16d1df2bcde22953a6e00146448f5e3d22a35223 100644
--- a/net/quic/quic_unacked_packet_map_test.cc
+++ b/net/quic/quic_unacked_packet_map_test.cc
@@ -35,6 +35,7 @@ class QuicUnackedPacketMapTest : public ::testing::Test {
void VerifyInFlightPackets(QuicPacketSequenceNumber* packets,
size_t num_packets) {
+ unacked_packets_.RemoveObsoletePackets();
if (num_packets == 0) {
EXPECT_FALSE(unacked_packets_.HasInFlightPackets());
EXPECT_FALSE(unacked_packets_.HasMultipleInFlightPackets());
@@ -53,7 +54,7 @@ class QuicUnackedPacketMapTest : public ::testing::Test {
size_t in_flight_count = 0;
for (QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin();
it != unacked_packets_.end(); ++it) {
- if (it->second.in_flight) {
+ if (it->in_flight) {
++in_flight_count;
}
}
@@ -62,6 +63,7 @@ class QuicUnackedPacketMapTest : public ::testing::Test {
void VerifyUnackedPackets(QuicPacketSequenceNumber* packets,
size_t num_packets) {
+ unacked_packets_.RemoveObsoletePackets();
if (num_packets == 0) {
EXPECT_FALSE(unacked_packets_.HasUnackedPackets());
EXPECT_FALSE(unacked_packets_.HasUnackedRetransmittableFrames());
@@ -71,20 +73,16 @@ class QuicUnackedPacketMapTest : public ::testing::Test {
for (size_t i = 0; i < num_packets; ++i) {
EXPECT_TRUE(unacked_packets_.IsUnacked(packets[i])) << packets[i];
}
- size_t unacked_count = 0;
- for (QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin();
- it != unacked_packets_.end(); ++it) {
- ++unacked_count;
- }
- EXPECT_EQ(num_packets, unacked_count);
+ EXPECT_EQ(num_packets, unacked_packets_.GetNumUnackedPacketsDebugOnly());
}
void VerifyRetransmittablePackets(QuicPacketSequenceNumber* packets,
size_t num_packets) {
+ unacked_packets_.RemoveObsoletePackets();
size_t num_retransmittable_packets = 0;
for (QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin();
it != unacked_packets_.end(); ++it) {
- if (it->second.retransmittable_frames != NULL) {
+ if (it->retransmittable_frames != NULL) {
++num_retransmittable_packets;
}
}
« no previous file with comments | « net/quic/quic_unacked_packet_map.cc ('k') | net/quic/test_tools/quic_sent_packet_manager_peer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698