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

Unified Diff: net/quic/congestion_control/tcp_cubic_sender_packets_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/tcp_cubic_sender_packets.cc ('k') | net/quic/crypto/crypto_protocol.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/congestion_control/tcp_cubic_sender_packets_test.cc
diff --git a/net/quic/congestion_control/tcp_cubic_sender_packets_test.cc b/net/quic/congestion_control/tcp_cubic_sender_packets_test.cc
index 6684e8df8132a2878af14e8f8d9d20649a20063e..03abc8e25605220985f73b433730153f975836fa 100644
--- a/net/quic/congestion_control/tcp_cubic_sender_packets_test.cc
+++ b/net/quic/congestion_control/tcp_cubic_sender_packets_test.cc
@@ -929,6 +929,36 @@ TEST_F(TcpCubicSenderPacketsTest, PaceBelowCWND) {
sender_->TimeUntilSend(QuicTime::Zero(), 4 * kDefaultTCPMSS).IsZero());
}
+TEST_F(TcpCubicSenderPacketsTest, NoPRR) {
+ ValueRestore<bool> old_flag(&FLAGS_quic_allow_noprr, true);
+ QuicTime::Delta rtt = QuicTime::Delta::FromMilliseconds(100);
+ sender_->rtt_stats_.UpdateRtt(rtt, QuicTime::Delta::Zero(), QuicTime::Zero());
+
+ sender_->SetNumEmulatedConnections(1);
+ // Verify that kCOPT: kNPRR allows all packets to be sent, even if only one
+ // ack has been received.
+ QuicTagVector options;
+ options.push_back(kNPRR);
+ QuicConfig config;
+ QuicConfigPeer::SetReceivedConnectionOptions(&config, options);
+ sender_->SetFromConfig(config, Perspective::IS_SERVER);
+ SendAvailableSendWindow();
+ LoseNPackets(9);
+ AckNPackets(1);
+
+ // We should now have fallen out of slow start with a reduced window.
+ EXPECT_EQ(kRenoBeta * kDefaultWindowTCP, sender_->GetCongestionWindow());
+ const QuicPacketCount window_in_packets =
+ kRenoBeta * kDefaultWindowTCP / kDefaultTCPMSS;
+ const QuicBandwidth expected_pacing_rate =
+ QuicBandwidth::FromBytesAndTimeDelta(kRenoBeta * kDefaultWindowTCP,
+ sender_->rtt_stats_.smoothed_rtt());
+ EXPECT_EQ(expected_pacing_rate, sender_->PacingRate());
+ EXPECT_EQ(window_in_packets,
+ static_cast<uint64_t>(SendAvailableSendWindow()));
+ EXPECT_EQ(expected_pacing_rate, sender_->PacingRate());
+}
+
TEST_F(TcpCubicSenderPacketsTest, ResetAfterConnectionMigration) {
EXPECT_EQ(kDefaultWindowTCP, sender_->GetCongestionWindow());
EXPECT_EQ(kMaxCongestionWindowPackets, sender_->slowstart_threshold());
« no previous file with comments | « net/quic/congestion_control/tcp_cubic_sender_packets.cc ('k') | net/quic/crypto/crypto_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698