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

Unified Diff: net/quic/quic_sent_packet_manager_test.cc

Issue 851503003: Update from https://crrev.com/311076 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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_sent_packet_manager.cc ('k') | net/quic/quic_server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_sent_packet_manager_test.cc
diff --git a/net/quic/quic_sent_packet_manager_test.cc b/net/quic/quic_sent_packet_manager_test.cc
index 92ce1dc3c8e4330275c3d122777368be8c730720..756c21a254d2ccddd8dadcb2bb112a9d1fce9b4a 100644
--- a/net/quic/quic_sent_packet_manager_test.cc
+++ b/net/quic/quic_sent_packet_manager_test.cc
@@ -799,6 +799,9 @@ TEST_F(QuicSentPacketManagerTest, TailLossProbeThenRTO) {
for (size_t i = 1; i <= kNumSentPackets; ++i) {
SendDataPacket(i);
}
+ QuicTime rto_packet_time = clock_.Now();
+ // Advance the time.
+ clock_.AdvanceTime(manager_.GetRetransmissionTime().Subtract(clock_.Now()));
// The first tail loss probe retransmits 1 packet.
manager_.OnRetransmissionTimeout();
@@ -813,6 +816,7 @@ TEST_F(QuicSentPacketManagerTest, TailLossProbeThenRTO) {
EXPECT_EQ(QuicTime::Delta::Infinite(),
manager_.TimeUntilSend(clock_.Now(), HAS_RETRANSMITTABLE_DATA));
EXPECT_FALSE(manager_.HasPendingRetransmissions());
+ clock_.AdvanceTime(manager_.GetRetransmissionTime().Subtract(clock_.Now()));
// The second tail loss probe retransmits 1 packet.
manager_.OnRetransmissionTimeout();
@@ -827,6 +831,15 @@ TEST_F(QuicSentPacketManagerTest, TailLossProbeThenRTO) {
EXPECT_EQ(QuicTime::Delta::Infinite(),
manager_.TimeUntilSend(clock_.Now(), HAS_RETRANSMITTABLE_DATA));
+ // Ensure the RTO is set based on the correct packet.
+ if (FLAGS_quic_rto_uses_last_sent) {
+ rto_packet_time = clock_.Now();
+ }
+ EXPECT_CALL(*send_algorithm_, RetransmissionDelay())
+ .WillOnce(Return(QuicTime::Delta::FromSeconds(1)));
+ EXPECT_EQ(rto_packet_time.Add(QuicTime::Delta::FromSeconds(1)),
+ manager_.GetRetransmissionTime());
+
// Advance the time enough to ensure all packets are RTO'd.
clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1000));
« no previous file with comments | « net/quic/quic_sent_packet_manager.cc ('k') | net/quic/quic_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698