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

Unified Diff: net/quic/congestion_control/tcp_loss_algorithm_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
Index: net/quic/congestion_control/tcp_loss_algorithm_test.cc
diff --git a/net/quic/congestion_control/tcp_loss_algorithm_test.cc b/net/quic/congestion_control/tcp_loss_algorithm_test.cc
index 5819fb1249d33708170c399e21781d97093c7257..fe6a6ea477b9786d7fe354c88622d024cc000d8e 100644
--- a/net/quic/congestion_control/tcp_loss_algorithm_test.cc
+++ b/net/quic/congestion_control/tcp_loss_algorithm_test.cc
@@ -12,8 +12,14 @@
#include "net/quic/test_tools/mock_clock.h"
#include "testing/gtest/include/gtest/gtest.h"
+using std::vector;
+
namespace net {
namespace test {
+namespace {
+
+// Default packet length.
+const uint32 kDefaultLength = 1000;
class TcpLossAlgorithmTest : public ::testing::Test {
protected:
@@ -24,9 +30,16 @@ class TcpLossAlgorithmTest : public ::testing::Test {
clock_.Now());
}
+ ~TcpLossAlgorithmTest() override {
+ STLDeleteElements(&packets_);
+ }
+
void SendDataPacket(QuicPacketSequenceNumber sequence_number) {
+ packets_.push_back(QuicPacket::NewDataPacket(
+ nullptr, kDefaultLength, false, PACKET_8BYTE_CONNECTION_ID, false,
+ PACKET_1BYTE_SEQUENCE_NUMBER));
SerializedPacket packet(sequence_number, PACKET_1BYTE_SEQUENCE_NUMBER,
- nullptr, 0, new RetransmittableFrames());
+ packets_.back(), 0, new RetransmittableFrames());
unacked_packets_.AddSentPacket(packet, 0, NOT_RETRANSMISSION, clock_.Now(),
1000, true);
}
@@ -43,6 +56,7 @@ class TcpLossAlgorithmTest : public ::testing::Test {
}
}
+ vector<QuicPacket*> packets_;
QuicUnackedPacketMap unacked_packets_;
TCPLossAlgorithm loss_algorithm_;
RttStats rtt_stats_;
@@ -179,5 +193,6 @@ TEST_F(TcpLossAlgorithmTest, DontEarlyRetransmitNeuteredPacket) {
EXPECT_EQ(QuicTime::Zero(), loss_algorithm_.GetLossTimeout());
}
+} // namespace
} // namespace test
} // namespace net
« no previous file with comments | « net/quic/congestion_control/tcp_loss_algorithm.cc ('k') | net/quic/congestion_control/time_loss_algorithm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698