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

Unified Diff: net/quic/congestion_control/time_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
« no previous file with comments | « net/quic/congestion_control/time_loss_algorithm.cc ('k') | net/quic/crypto/common_cert_set.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/congestion_control/time_loss_algorithm_test.cc
diff --git a/net/quic/congestion_control/time_loss_algorithm_test.cc b/net/quic/congestion_control/time_loss_algorithm_test.cc
index b964d2863a47a13585f6d2cbc17ccc81bedd66d9..1e9b7e5610b80512a9c8fbb9f6778c7b5b291ffe 100644
--- a/net/quic/congestion_control/time_loss_algorithm_test.cc
+++ b/net/quic/congestion_control/time_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 TimeLossAlgorithmTest : public ::testing::Test {
protected:
@@ -24,9 +30,16 @@ class TimeLossAlgorithmTest : public ::testing::Test {
clock_.Now());
}
+ ~TimeLossAlgorithmTest() 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 TimeLossAlgorithmTest : public ::testing::Test {
}
}
+ vector<QuicPacket*> packets_;
QuicUnackedPacketMap unacked_packets_;
TimeLossAlgorithm loss_algorithm_;
RttStats rtt_stats_;
@@ -134,5 +148,6 @@ TEST_F(TimeLossAlgorithmTest, MultipleLossesAtOnce) {
EXPECT_EQ(QuicTime::Zero(), loss_algorithm_.GetLossTimeout());
}
+} // namespace
} // namespace test
} // namespace net
« no previous file with comments | « net/quic/congestion_control/time_loss_algorithm.cc ('k') | net/quic/crypto/common_cert_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698