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

Unified Diff: net/quic/congestion_control/pacing_sender_test.cc

Issue 2002103002: Implement a QUIC No PRR connection option, NPRR. Protected by FLAGS_quic_allow_no_prr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@122422703
Patch Set: Created 4 years, 7 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/congestion_control/pacing_sender.cc ('k') | net/quic/congestion_control/tcp_cubic_sender_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/congestion_control/pacing_sender_test.cc
diff --git a/net/quic/congestion_control/pacing_sender_test.cc b/net/quic/congestion_control/pacing_sender_test.cc
index e6dfcb6251bf1c3e84cdf1d7c886869c52cc2bae..e1f7b2e88d0b8d4d31339d3569c32f44272e8d8b 100644
--- a/net/quic/congestion_control/pacing_sender_test.cc
+++ b/net/quic/congestion_control/pacing_sender_test.cc
@@ -298,6 +298,32 @@ TEST_F(PacingSenderTest, FastSending) {
CheckPacketIsDelayed(QuicTime::Delta::FromMicroseconds(1500));
}
+TEST_F(PacingSenderTest, NoBurstEnteringRecovery) {
+ ValueRestore<bool> old_flag(&FLAGS_quic_allow_noprr, true);
+ // Configure pacing rate of 1 packet per 1 ms with no burst tokens.
+ InitPacingRate(0, QuicBandwidth::FromBytesAndTimeDelta(
+ kMaxPacketSize, QuicTime::Delta::FromMilliseconds(1)));
+ // Sending a packet will set burst tokens.
+ CheckPacketIsSentImmediately();
+
+ // Losing a packet will set clear burst tokens.
+ SendAlgorithmInterface::CongestionVector lost_packets;
+ lost_packets.push_back(std::make_pair(1, kMaxPacketSize));
+ SendAlgorithmInterface::CongestionVector empty;
+ EXPECT_CALL(*mock_sender_,
+ OnCongestionEvent(true, kMaxPacketSize, empty, lost_packets));
+ pacing_sender_->OnCongestionEvent(true, kMaxPacketSize, empty, lost_packets);
+ // One packet is sent immediately, because of 1ms pacing granularity.
+ CheckPacketIsSentImmediately();
+ // Ensure packets are immediately paced.
+ EXPECT_CALL(*mock_sender_, TimeUntilSend(clock_.Now(), kDefaultTCPMSS))
+ .WillOnce(Return(zero_time_));
+ // Verify the next packet is paced and delayed 2ms due to granularity.
+ EXPECT_EQ(QuicTime::Delta::FromMilliseconds(2),
+ pacing_sender_->TimeUntilSend(clock_.Now(), kDefaultTCPMSS));
+ CheckPacketIsDelayed(QuicTime::Delta::FromMilliseconds(2));
+}
+
TEST_F(PacingSenderTest, NoBurstInRecovery) {
// Configure pacing rate of 1 packet per 1 ms with no burst tokens.
InitPacingRate(0, QuicBandwidth::FromBytesAndTimeDelta(
« no previous file with comments | « net/quic/congestion_control/pacing_sender.cc ('k') | net/quic/congestion_control/tcp_cubic_sender_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698