| Index: net/quic/congestion_control/tcp_cubic_sender_bytes_test.cc
|
| diff --git a/net/quic/congestion_control/tcp_cubic_sender_bytes_test.cc b/net/quic/congestion_control/tcp_cubic_sender_bytes_test.cc
|
| index d790f6239076738062639baebe22e70c5e1d4902..e845f3e181f9184c47e307f7023d550f7cc431c7 100644
|
| --- a/net/quic/congestion_control/tcp_cubic_sender_bytes_test.cc
|
| +++ b/net/quic/congestion_control/tcp_cubic_sender_bytes_test.cc
|
| @@ -780,6 +780,36 @@ TEST_F(TcpCubicSenderBytesTest, PaceBelowCWND) {
|
| sender_->TimeUntilSend(QuicTime::Zero(), 4 * kDefaultTCPMSS).IsZero());
|
| }
|
|
|
| +TEST_F(TcpCubicSenderBytesTest, 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(TcpCubicSenderBytesTest, ResetAfterConnectionMigration) {
|
| // Starts from slow start.
|
| sender_->SetNumEmulatedConnections(1);
|
|
|