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

Unified Diff: net/quic/quic_unacked_packet_map_test.cc

Issue 754433003: Update from https://crrev.com/305340 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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 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/crypto_test_utils.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 d31ce4425b0e187dcf65756496b79656f1a1bec7..7840495507402656322730af6c8154568d8a21a6 100644
--- a/net/quic/quic_unacked_packet_map_test.cc
+++ b/net/quic/quic_unacked_packet_map_test.cc
@@ -8,6 +8,7 @@
#include "testing/gtest/include/gtest/gtest.h"
using std::min;
+using std::vector;
namespace net {
namespace test {
@@ -23,16 +24,26 @@ class QuicUnackedPacketMapTest : public ::testing::Test {
: now_(QuicTime::Zero().Add(QuicTime::Delta::FromMilliseconds(1000))) {
}
+ ~QuicUnackedPacketMapTest() override {
+ STLDeleteElements(&packets_);
+ }
+
SerializedPacket CreateRetransmittablePacket(
QuicPacketSequenceNumber sequence_number) {
+ packets_.push_back(QuicPacket::NewDataPacket(
+ nullptr, kDefaultLength, false, PACKET_8BYTE_CONNECTION_ID, false,
+ PACKET_1BYTE_SEQUENCE_NUMBER));
return SerializedPacket(sequence_number, PACKET_1BYTE_SEQUENCE_NUMBER,
- nullptr, 0, new RetransmittableFrames());
+ packets_.back(), 0, new RetransmittableFrames());
}
SerializedPacket CreateNonRetransmittablePacket(
QuicPacketSequenceNumber sequence_number) {
+ packets_.push_back(QuicPacket::NewDataPacket(
+ nullptr, kDefaultLength, false, PACKET_8BYTE_CONNECTION_ID, false,
+ PACKET_1BYTE_SEQUENCE_NUMBER));
return SerializedPacket(sequence_number, PACKET_1BYTE_SEQUENCE_NUMBER,
- nullptr, 0, nullptr);
+ packets_.back(), 0, nullptr);
}
void VerifyInFlightPackets(QuicPacketSequenceNumber* packets,
@@ -94,7 +105,7 @@ class QuicUnackedPacketMapTest : public ::testing::Test {
<< " packets[" << i << "]:" << packets[i];
}
}
-
+ vector<QuicPacket*> packets_;
QuicUnackedPacketMap unacked_packets_;
QuicTime now_;
};
@@ -185,8 +196,8 @@ TEST_F(QuicUnackedPacketMapTest, RetransmittedPacket) {
unacked_packets_.RemoveFromInFlight(2);
QuicPacketSequenceNumber unacked2[] = { 1 };
- VerifyUnackedPackets(unacked, arraysize(unacked2));
- VerifyInFlightPackets(unacked, arraysize(unacked2));
+ VerifyUnackedPackets(unacked2, arraysize(unacked2));
+ VerifyInFlightPackets(unacked2, arraysize(unacked2));
VerifyRetransmittablePackets(nullptr, 0);
unacked_packets_.RemoveFromInFlight(1);
« no previous file with comments | « net/quic/quic_unacked_packet_map.cc ('k') | net/quic/test_tools/crypto_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698