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

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

Issue 608003002: Add a test to ensure QUIC's TcpCubicSender always allows packets to be (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Merge_QuicSentPacketManager_DebugDelegate_76088200
Patch Set: Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/congestion_control/tcp_cubic_sender_test.cc
diff --git a/net/quic/congestion_control/tcp_cubic_sender_test.cc b/net/quic/congestion_control/tcp_cubic_sender_test.cc
index f6afdc8122852f3143930d9ba6ed9824cb87ae2a..c01e0c7498eaed0ec6c95bdf4e3a5eb4c6b1e259 100644
--- a/net/quic/congestion_control/tcp_cubic_sender_test.cc
+++ b/net/quic/congestion_control/tcp_cubic_sender_test.cc
@@ -21,7 +21,8 @@ using std::min;
namespace net {
namespace test {
-const uint32 kDefaultWindowTCP = 10 * kDefaultTCPMSS;
+const int64 kInitialCongestionWindow = 10;
+const uint32 kDefaultWindowTCP = kInitialCongestionWindow * kDefaultTCPMSS;
// TODO(ianswett): Remove 10000 once b/10075719 is fixed.
const QuicTcpCongestionWindow kDefaultMaxCongestionWindowTCP = 10000;
@@ -299,6 +300,19 @@ TEST_F(TcpCubicSenderTest, SlowStartPacketLoss) {
EXPECT_FALSE(sender_->hybrid_slow_start().started());
}
+TEST_F(TcpCubicSenderTest, NoPRRWhenLessThanOnePacketInFlight) {
+ SendAvailableSendWindow();
+ LoseNPackets(kInitialCongestionWindow - 1);
+ AckNPackets(1);
+ // PRR will allow 2 packets for every ack during recovery.
+ EXPECT_EQ(2, SendAvailableSendWindow());
+ // Simulate abandoning all packets by supplying a bytes_in_flight of 0.
+ // PRR should now allow a packet to be sent, even though prr's state
+ // variables believe it has sent enough packets.
+ EXPECT_EQ(QuicTime::Delta::Zero(),
+ sender_->TimeUntilSend(clock_.Now(), 0, HAS_RETRANSMITTABLE_DATA));
+}
+
TEST_F(TcpCubicSenderTest, SlowStartPacketLossPRR) {
// Test based on the first example in RFC6937.
// Ack 10 packets in 5 acks to raise the CWND to 20, as in the example.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698