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

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

Issue 1983183002: Landing Recent QUIC changes until 5/14/2016 02:25:25 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: "first try to fix link error for win_clang build" 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 12846d355352e3ca37c1d79e707863ec60105a3b..6f831061d4415a36640179a7a1400ae14ba81767 100644
--- a/net/quic/congestion_control/tcp_cubic_sender_packets_test.cc
+++ b/net/quic/congestion_control/tcp_cubic_sender_packets_test.cc
@@ -28,6 +28,7 @@ namespace test {
// an initial CWND of 10. They have carefully calculated values which should be
// updated to be based on kInitialCongestionWindow.
const uint32_t kInitialCongestionWindowPackets = 10;
+const uint32_t kMaxCongestionWindowPackets = 200;
const uint32_t kDefaultWindowTCP =
kInitialCongestionWindowPackets * kDefaultTCPMSS;
const float kRenoBeta = 0.7f; // Reno backoff factor.
@@ -62,8 +63,9 @@ class TcpCubicSenderPacketsTest : public ::testing::Test {
protected:
TcpCubicSenderPacketsTest()
: one_ms_(QuicTime::Delta::FromMilliseconds(1)),
- sender_(
- new TcpCubicSenderPacketsPeer(&clock_, true, kMaxCongestionWindow)),
+ sender_(new TcpCubicSenderPacketsPeer(&clock_,
+ true,
+ kMaxCongestionWindowPackets)),
packet_number_(1),
acked_packet_number_(0),
bytes_in_flight_(0) {}
@@ -487,7 +489,7 @@ TEST_F(TcpCubicSenderPacketsTest, SlowStartBurstPacketLossPRR) {
TEST_F(TcpCubicSenderPacketsTest, RTOCongestionWindow) {
EXPECT_EQ(kDefaultWindowTCP, sender_->GetCongestionWindow());
- EXPECT_EQ(kMaxCongestionWindow, sender_->slowstart_threshold());
+ EXPECT_EQ(kMaxCongestionWindowPackets, sender_->slowstart_threshold());
// Expect the window to decrease to the minimum once the RTO fires
// and slow start threshold to be set to 1/2 of the CWND.
@@ -879,9 +881,9 @@ TEST_F(TcpCubicSenderPacketsTest, BandwidthResumption) {
// Resumed CWND is limited to be in a sensible range.
cached_network_params.set_bandwidth_estimate_bytes_per_second(
- (kMaxCongestionWindow + 1) * kDefaultTCPMSS);
+ (kMaxCongestionWindowPackets + 1) * kDefaultTCPMSS);
sender_->ResumeConnectionState(cached_network_params, false);
- EXPECT_EQ(kMaxCongestionWindow, sender_->congestion_window());
+ EXPECT_EQ(kMaxCongestionWindowPackets, sender_->congestion_window());
if (FLAGS_quic_no_lower_bw_resumption_limit) {
// Resume with an illegal value of 0 and verify the server uses 1 instead.
@@ -898,9 +900,9 @@ TEST_F(TcpCubicSenderPacketsTest, BandwidthResumption) {
// Resume to the max value.
cached_network_params.set_max_bandwidth_estimate_bytes_per_second(
- kMaxCongestionWindow * kDefaultTCPMSS);
+ kMaxCongestionWindowPackets * kDefaultTCPMSS);
sender_->ResumeConnectionState(cached_network_params, true);
- EXPECT_EQ(kMaxCongestionWindow * kDefaultTCPMSS,
+ EXPECT_EQ(kMaxCongestionWindowPackets * kDefaultTCPMSS,
sender_->GetCongestionWindow());
}
@@ -927,7 +929,7 @@ TEST_F(TcpCubicSenderPacketsTest, PaceBelowCWND) {
TEST_F(TcpCubicSenderPacketsTest, ResetAfterConnectionMigration) {
EXPECT_EQ(kDefaultWindowTCP, sender_->GetCongestionWindow());
- EXPECT_EQ(kMaxCongestionWindow, sender_->slowstart_threshold());
+ EXPECT_EQ(kMaxCongestionWindowPackets, sender_->slowstart_threshold());
// Starts with slow start.
sender_->SetNumEmulatedConnections(1);
@@ -955,7 +957,7 @@ TEST_F(TcpCubicSenderPacketsTest, ResetAfterConnectionMigration) {
// Resets cwnd and slow start threshold on connection migrations.
sender_->OnConnectionMigration();
EXPECT_EQ(kDefaultWindowTCP, sender_->GetCongestionWindow());
- EXPECT_EQ(kMaxCongestionWindow, sender_->slowstart_threshold());
+ EXPECT_EQ(kMaxCongestionWindowPackets, sender_->slowstart_threshold());
EXPECT_FALSE(sender_->hybrid_slow_start().started());
}
« 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