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

Unified Diff: net/quic/core/quic_connection_test.cc

Issue 2393933002: Move the logic from SendAlgorithmInterface::RetransmissionDelay() into QuicSentPacketManager, becau… (Closed)
Patch Set: Created 4 years, 2 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
Index: net/quic/core/quic_connection_test.cc
diff --git a/net/quic/core/quic_connection_test.cc b/net/quic/core/quic_connection_test.cc
index 3bf6045f6df72355efeb75132dad821de2164a72..2ae0f776812cb610f337bb5685b71861c700fa8e 100644
--- a/net/quic/core/quic_connection_test.cc
+++ b/net/quic/core/quic_connection_test.cc
@@ -722,8 +722,6 @@ class QuicConnectionTest : public ::testing::TestWithParam<TestParams> {
.WillRepeatedly(Return(QuicTime::Delta::Zero()));
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _))
.Times(AnyNumber());
- EXPECT_CALL(*send_algorithm_, RetransmissionDelay())
- .WillRepeatedly(Return(QuicTime::Delta::Zero()));
EXPECT_CALL(*send_algorithm_, GetCongestionWindow())
.WillRepeatedly(Return(kDefaultTCPMSS));
EXPECT_CALL(*send_algorithm_, PacingRate(_))
@@ -2774,15 +2772,18 @@ TEST_P(QuicConnectionTest, DelayRTOWithAckReceipt) {
EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _));
QuicAckFrame ack = InitAckFrame(1);
ProcessAckPacket(&ack);
+ // Now we have an RTT sample of DefaultRetransmissionTime(500ms),
+ // so the RTO has increased to 2 * SRTT.
EXPECT_TRUE(retransmission_alarm->IsSet());
- EXPECT_GT(retransmission_alarm->deadline(), clock_.Now());
+ EXPECT_EQ(retransmission_alarm->deadline(),
+ clock_.Now() + 2 * DefaultRetransmissionTime());
// Move forward past the original RTO and ensure the RTO is still pending.
clock_.AdvanceTime(2 * DefaultRetransmissionTime());
// Ensure the second packet gets retransmitted when it finally fires.
EXPECT_TRUE(retransmission_alarm->IsSet());
- EXPECT_LT(retransmission_alarm->deadline(), clock_.ApproximateNow());
+ EXPECT_EQ(retransmission_alarm->deadline(), clock_.ApproximateNow());
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _));
// Manually cancel the alarm to simulate a real test.
connection_.GetRetransmissionAlarm()->Fire();
« no previous file with comments | « net/quic/core/congestion_control/tcp_cubic_sender_packets_test.cc ('k') | net/quic/core/quic_sent_packet_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698