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

Unified Diff: net/quic/core/congestion_control/cubic_bytes_test.cc

Issue 2351963005: Limit QUIC's Cubic CWND increases to 1/2 the bytes acked when in (Closed)
Patch Set: Created 4 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 | « net/quic/core/congestion_control/cubic_bytes.cc ('k') | net/quic/core/congestion_control/cubic_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/congestion_control/cubic_bytes_test.cc
diff --git a/net/quic/core/congestion_control/cubic_bytes_test.cc b/net/quic/core/congestion_control/cubic_bytes_test.cc
index b799066d3431d28a96fd4749e5687f6bc00b9d02..8c5f12d48fe4b4ce80efab15c0415bbe2263c521 100644
--- a/net/quic/core/congestion_control/cubic_bytes_test.cc
+++ b/net/quic/core/congestion_control/cubic_bytes_test.cc
@@ -5,6 +5,7 @@
#include "net/quic/core/congestion_control/cubic_bytes.h"
#include "base/logging.h"
+#include "net/quic/core/quic_flags.h"
#include "net/quic/test_tools/mock_clock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -33,7 +34,9 @@ TEST_F(CubicBytesTest, AboveOrigin) {
// Convex growth.
const QuicTime::Delta rtt_min = hundred_ms_;
QuicByteCount current_cwnd = 10 * kDefaultTCPMSS;
- QuicByteCount expected_cwnd = current_cwnd + kDefaultTCPMSS;
+ QuicByteCount expected_cwnd =
+ current_cwnd + (FLAGS_quic_limit_cubic_cwnd_increase ? kDefaultTCPMSS / 2
+ : kDefaultTCPMSS);
// Initialize the state.
clock_.AdvanceTime(one_ms_);
EXPECT_EQ(expected_cwnd, cubic_.CongestionWindowAfterAck(
@@ -77,7 +80,9 @@ TEST_F(CubicBytesTest, AboveOrigin) {
TEST_F(CubicBytesTest, LossEvents) {
const QuicTime::Delta rtt_min = hundred_ms_;
QuicByteCount current_cwnd = 422 * kDefaultTCPMSS;
- QuicPacketCount expected_cwnd = current_cwnd + kDefaultTCPMSS;
+ QuicPacketCount expected_cwnd =
+ current_cwnd + (FLAGS_quic_limit_cubic_cwnd_increase ? kDefaultTCPMSS / 2
+ : kDefaultTCPMSS);
// Initialize the state.
clock_.AdvanceTime(one_ms_);
EXPECT_EQ(expected_cwnd, cubic_.CongestionWindowAfterAck(
@@ -94,7 +99,9 @@ TEST_F(CubicBytesTest, BelowOrigin) {
// Concave growth.
const QuicTime::Delta rtt_min = hundred_ms_;
QuicByteCount current_cwnd = 422 * kDefaultTCPMSS;
- QuicPacketCount expected_cwnd = current_cwnd + kDefaultTCPMSS;
+ QuicPacketCount expected_cwnd =
+ current_cwnd + (FLAGS_quic_limit_cubic_cwnd_increase ? kDefaultTCPMSS / 2
+ : kDefaultTCPMSS);
// Initialize the state.
clock_.AdvanceTime(one_ms_);
EXPECT_EQ(expected_cwnd, cubic_.CongestionWindowAfterAck(
@@ -112,7 +119,8 @@ TEST_F(CubicBytesTest, BelowOrigin) {
current_cwnd =
cubic_.CongestionWindowAfterAck(kDefaultTCPMSS, current_cwnd, rtt_min);
}
- expected_cwnd = 422 * kDefaultTCPMSS;
+ expected_cwnd =
+ FLAGS_quic_limit_cubic_cwnd_increase ? 553632 : 422 * kDefaultTCPMSS;
EXPECT_EQ(expected_cwnd, current_cwnd);
}
« no previous file with comments | « net/quic/core/congestion_control/cubic_bytes.cc ('k') | net/quic/core/congestion_control/cubic_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698