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

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

Issue 1814843002: Remove the unused has_retransmittable_data argument from QuicSendAlgorithm::TimeUntilSend. No func… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@116887287
Patch Set: Created 4 years, 9 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/quic_connection_test.cc » ('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 0d04e6e0fe6982fd2bf550431afdd750cd2016b7..0b37f1c10c6159e647ae30d42e06db2c144ce67d 100644
--- a/net/quic/congestion_control/tcp_cubic_sender_packets_test.cc
+++ b/net/quic/congestion_control/tcp_cubic_sender_packets_test.cc
@@ -71,19 +71,15 @@ class TcpCubicSenderPacketsTest : public ::testing::Test {
int SendAvailableSendWindow() {
// Send as long as TimeUntilSend returns Zero.
int packets_sent = 0;
- bool can_send = sender_
- ->TimeUntilSend(clock_.Now(), bytes_in_flight_,
- HAS_RETRANSMITTABLE_DATA)
- .IsZero();
+ bool can_send =
+ sender_->TimeUntilSend(clock_.Now(), bytes_in_flight_).IsZero();
while (can_send) {
sender_->OnPacketSent(clock_.Now(), bytes_in_flight_, packet_number_++,
kDefaultTCPMSS, HAS_RETRANSMITTABLE_DATA);
++packets_sent;
bytes_in_flight_ += kDefaultTCPMSS;
- can_send = sender_
- ->TimeUntilSend(clock_.Now(), bytes_in_flight_,
- HAS_RETRANSMITTABLE_DATA)
- .IsZero();
+ can_send =
+ sender_->TimeUntilSend(clock_.Now(), bytes_in_flight_).IsZero();
}
return packets_sent;
}
@@ -140,31 +136,26 @@ TEST_F(TcpCubicSenderPacketsTest, SimpleSender) {
// At startup make sure we are at the default.
EXPECT_EQ(kDefaultWindowTCP, sender_->GetCongestionWindow());
// At startup make sure we can send.
- EXPECT_TRUE(sender_->TimeUntilSend(clock_.Now(), 0, HAS_RETRANSMITTABLE_DATA)
- .IsZero());
+ EXPECT_TRUE(sender_->TimeUntilSend(clock_.Now(), 0).IsZero());
// Make sure we can send.
- EXPECT_TRUE(sender_->TimeUntilSend(clock_.Now(), 0, HAS_RETRANSMITTABLE_DATA)
- .IsZero());
+ EXPECT_TRUE(sender_->TimeUntilSend(clock_.Now(), 0).IsZero());
// And that window is un-affected.
EXPECT_EQ(kDefaultWindowTCP, sender_->GetCongestionWindow());
// Fill the send window with data, then verify that we can't send.
SendAvailableSendWindow();
- EXPECT_FALSE(sender_
- ->TimeUntilSend(clock_.Now(), sender_->GetCongestionWindow(),
- HAS_RETRANSMITTABLE_DATA)
- .IsZero());
+ EXPECT_FALSE(
+ sender_->TimeUntilSend(clock_.Now(), sender_->GetCongestionWindow())
+ .IsZero());
}
TEST_F(TcpCubicSenderPacketsTest, ApplicationLimitedSlowStart) {
// Send exactly 10 packets and ensure the CWND ends at 14 packets.
const int kNumberOfAcks = 5;
// At startup make sure we can send.
- EXPECT_TRUE(sender_->TimeUntilSend(clock_.Now(), 0, HAS_RETRANSMITTABLE_DATA)
- .IsZero());
+ EXPECT_TRUE(sender_->TimeUntilSend(clock_.Now(), 0).IsZero());
// Make sure we can send.
- EXPECT_TRUE(sender_->TimeUntilSend(clock_.Now(), 0, HAS_RETRANSMITTABLE_DATA)
- .IsZero());
+ EXPECT_TRUE(sender_->TimeUntilSend(clock_.Now(), 0).IsZero());
SendAvailableSendWindow();
for (int i = 0; i < kNumberOfAcks; ++i) {
@@ -179,12 +170,10 @@ TEST_F(TcpCubicSenderPacketsTest, ApplicationLimitedSlowStart) {
TEST_F(TcpCubicSenderPacketsTest, ExponentialSlowStart) {
const int kNumberOfAcks = 20;
// At startup make sure we can send.
- EXPECT_TRUE(sender_->TimeUntilSend(clock_.Now(), 0, HAS_RETRANSMITTABLE_DATA)
- .IsZero());
+ EXPECT_TRUE(sender_->TimeUntilSend(clock_.Now(), 0).IsZero());
EXPECT_EQ(QuicBandwidth::Zero(), sender_->BandwidthEstimate());
// Make sure we can send.
- EXPECT_TRUE(sender_->TimeUntilSend(clock_.Now(), 0, HAS_RETRANSMITTABLE_DATA)
- .IsZero());
+ EXPECT_TRUE(sender_->TimeUntilSend(clock_.Now(), 0).IsZero());
for (int i = 0; i < kNumberOfAcks; ++i) {
// Send our full send window.
@@ -309,8 +298,7 @@ TEST_F(TcpCubicSenderPacketsTest, NoPRRWhenLessThanOnePacketInFlight) {
// 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));
+ EXPECT_EQ(QuicTime::Delta::Zero(), sender_->TimeUntilSend(clock_.Now(), 0));
}
TEST_F(TcpCubicSenderPacketsTest, SlowStartPacketLossPRR) {
@@ -387,10 +375,7 @@ TEST_F(TcpCubicSenderPacketsTest, SlowStartBurstPacketLossPRR) {
LoseNPackets(num_packets_to_lose);
// Immediately after the loss, ensure at least one packet can be sent.
// Losses without subsequent acks can occur with timer based loss detection.
- EXPECT_TRUE(sender_
- ->TimeUntilSend(clock_.Now(), bytes_in_flight_,
- HAS_RETRANSMITTABLE_DATA)
- .IsZero());
+ EXPECT_TRUE(sender_->TimeUntilSend(clock_.Now(), bytes_in_flight_).IsZero());
AckNPackets(1);
// We should now have fallen out of slow start with a reduced window.
@@ -844,22 +829,14 @@ TEST_F(TcpCubicSenderPacketsTest, PaceBelowCWND) {
sender_->SetFromConfig(config, Perspective::IS_SERVER);
sender_->OnRetransmissionTimeout(true);
EXPECT_EQ(1u, sender_->congestion_window());
- EXPECT_TRUE(sender_
- ->TimeUntilSend(QuicTime::Zero(), kDefaultTCPMSS,
- HAS_RETRANSMITTABLE_DATA)
- .IsZero());
- EXPECT_TRUE(sender_
- ->TimeUntilSend(QuicTime::Zero(), 2 * kDefaultTCPMSS,
- HAS_RETRANSMITTABLE_DATA)
- .IsZero());
- EXPECT_TRUE(sender_
- ->TimeUntilSend(QuicTime::Zero(), 3 * kDefaultTCPMSS,
- HAS_RETRANSMITTABLE_DATA)
- .IsZero());
- EXPECT_FALSE(sender_
- ->TimeUntilSend(QuicTime::Zero(), 4 * kDefaultTCPMSS,
- HAS_RETRANSMITTABLE_DATA)
- .IsZero());
+ EXPECT_TRUE(
+ sender_->TimeUntilSend(QuicTime::Zero(), kDefaultTCPMSS).IsZero());
+ EXPECT_TRUE(
+ sender_->TimeUntilSend(QuicTime::Zero(), 2 * kDefaultTCPMSS).IsZero());
+ EXPECT_TRUE(
+ sender_->TimeUntilSend(QuicTime::Zero(), 3 * kDefaultTCPMSS).IsZero());
+ EXPECT_FALSE(
+ sender_->TimeUntilSend(QuicTime::Zero(), 4 * kDefaultTCPMSS).IsZero());
}
TEST_F(TcpCubicSenderPacketsTest, ResetAfterConnectionMigration) {
« no previous file with comments | « net/quic/congestion_control/tcp_cubic_sender_bytes_test.cc ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698