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

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

Issue 2064543002: Add a new rate based sending connection option which uses the pacing rate to keep the bytes_in_flig… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@124273380
Patch Set: Rebase. Created 4 years, 6 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_bytes_test.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 03abc8e25605220985f73b433730153f975836fa..91094a692013666d928b92d241590363f3a71169 100644
--- a/net/quic/congestion_control/tcp_cubic_sender_packets_test.cc
+++ b/net/quic/congestion_control/tcp_cubic_sender_packets_test.cc
@@ -953,10 +953,44 @@ TEST_F(TcpCubicSenderPacketsTest, NoPRR) {
const QuicBandwidth expected_pacing_rate =
QuicBandwidth::FromBytesAndTimeDelta(kRenoBeta * kDefaultWindowTCP,
sender_->rtt_stats_.smoothed_rtt());
- EXPECT_EQ(expected_pacing_rate, sender_->PacingRate());
+ EXPECT_EQ(expected_pacing_rate, sender_->PacingRate(0));
EXPECT_EQ(window_in_packets,
static_cast<uint64_t>(SendAvailableSendWindow()));
- EXPECT_EQ(expected_pacing_rate, sender_->PacingRate());
+ EXPECT_EQ(expected_pacing_rate,
+ sender_->PacingRate(kRenoBeta * kDefaultWindowTCP));
+}
+
+TEST_F(TcpCubicSenderPacketsTest, PaceSlowerAboveCwnd) {
+ ValueRestore<bool> old_flag(&FLAGS_quic_rate_based_sending, true);
+ QuicTime::Delta rtt(QuicTime::Delta::FromMilliseconds(60));
+ sender_->rtt_stats_.UpdateRtt(rtt, QuicTime::Delta::Zero(), clock_.Now());
+
+ QuicConfig config;
+ QuicTagVector options;
+ options.push_back(kRATE);
+ QuicConfigPeer::SetReceivedConnectionOptions(&config, options);
+ sender_->SetFromConfig(config, Perspective::IS_SERVER);
+ EXPECT_EQ(10u, sender_->congestion_window());
+ sender_->SetNumEmulatedConnections(1);
+ // Lose a packet to exit slow start.
+ LoseNPackets(1);
+ const QuicPacketCount cwnd = 7;
+ EXPECT_EQ(cwnd * kDefaultTCPMSS, sender_->GetCongestionWindow());
+
+ EXPECT_TRUE(
+ sender_->TimeUntilSend(QuicTime::Zero(), kDefaultTCPMSS).IsZero());
+ EXPECT_EQ(sender_->PacingRate(kDefaultTCPMSS),
+ QuicBandwidth::FromBytesAndTimeDelta(7 * kDefaultTCPMSS, rtt)
+ .Scale(1.25));
+ for (QuicPacketCount i = cwnd + 1; i < 1.5 * cwnd; ++i) {
+ EXPECT_TRUE(
+ sender_->TimeUntilSend(QuicTime::Zero(), i * kDefaultTCPMSS).IsZero());
+ EXPECT_EQ(sender_->PacingRate(i * kDefaultTCPMSS),
+ QuicBandwidth::FromBytesAndTimeDelta(cwnd * kDefaultTCPMSS, rtt)
+ .Scale(0.75));
+ }
+ EXPECT_FALSE(
+ sender_->TimeUntilSend(QuicTime::Zero(), 11 * kDefaultTCPMSS).IsZero());
}
TEST_F(TcpCubicSenderPacketsTest, ResetAfterConnectionMigration) {
« no previous file with comments | « net/quic/congestion_control/tcp_cubic_sender_bytes_test.cc ('k') | net/quic/crypto/crypto_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698