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

Unified Diff: modules/remote_bitrate_estimator/aimd_rate_control_unittest.cc

Issue 3011323002: Rollback of "Use small BWE period when there is a true network degradation" (Closed)
Patch Set: Created 3 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 | « modules/remote_bitrate_estimator/aimd_rate_control.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/remote_bitrate_estimator/aimd_rate_control_unittest.cc
diff --git a/modules/remote_bitrate_estimator/aimd_rate_control_unittest.cc b/modules/remote_bitrate_estimator/aimd_rate_control_unittest.cc
index a7bb752ee628a332a8a0d7a9470007f78c723b2d..690eb688f0211507c4920e2a9878321646f999a9 100644
--- a/modules/remote_bitrate_estimator/aimd_rate_control_unittest.cc
+++ b/modules/remote_bitrate_estimator/aimd_rate_control_unittest.cc
@@ -18,8 +18,9 @@ namespace {
constexpr int64_t kClockInitialTime = 123456;
-constexpr int kMinBwePeriodMs = 500;
+constexpr int kMinBwePeriodMs = 2000;
constexpr int kMaxBwePeriodMs = 50000;
+constexpr int kDefaultPeriodMs = 3000;
// After an overuse, we back off to 85% to the received bitrate.
constexpr double kFractionAfterOveruse = 0.85;
@@ -81,8 +82,7 @@ TEST(AimdRateControlTest, GetIncreaseRateAndBandwidthPeriod) {
states.simulated_clock->TimeInMilliseconds());
EXPECT_NEAR(14000, states.aimd_rate_control->GetNearMaxIncreaseRateBps(),
1000);
- EXPECT_EQ(kMinBwePeriodMs,
- states.aimd_rate_control->GetExpectedBandwidthPeriodMs());
+ EXPECT_EQ(3000, states.aimd_rate_control->GetExpectedBandwidthPeriodMs());
}
TEST(AimdRateControlTest, BweLimitedByAckedBitrate) {
@@ -124,15 +124,15 @@ TEST(AimdRateControlTest, BweNotLimitedByDecreasingAckedBitrate) {
EXPECT_EQ(new_estimate, prev_estimate);
}
-TEST(AimdRateControlTest, MinPeriodUntilFirstOveruse) {
+TEST(AimdRateControlTest, DefaultPeriodUntilFirstOveruse) {
auto states = CreateAimdRateControlStates();
states.aimd_rate_control->SetStartBitrate(300000);
- EXPECT_EQ(kMinBwePeriodMs,
+ EXPECT_EQ(kDefaultPeriodMs,
states.aimd_rate_control->GetExpectedBandwidthPeriodMs());
states.simulated_clock->AdvanceTimeMilliseconds(100);
- UpdateRateControl(states, BandwidthUsage::kBwOverusing, 280000,
+ UpdateRateControl(states, BandwidthUsage::kBwOverusing, 100000,
states.simulated_clock->TimeInMilliseconds());
- EXPECT_NE(kMinBwePeriodMs,
+ EXPECT_NE(kDefaultPeriodMs,
states.aimd_rate_control->GetExpectedBandwidthPeriodMs());
}
@@ -152,21 +152,6 @@ TEST(AimdRateControlTest, ExpectedPeriodAfter20kbpsDropAnd5kbpsIncrease) {
EXPECT_EQ(4000, states.aimd_rate_control->GetExpectedBandwidthPeriodMs());
}
-TEST(AimdRateControlTest, MinPeriodAfterLargeBitrateDecrease) {
- auto states = CreateAimdRateControlStates();
- constexpr int kInitialBitrate = 110000;
- states.aimd_rate_control->SetEstimate(
- kInitialBitrate, states.simulated_clock->TimeInMilliseconds());
- states.simulated_clock->AdvanceTimeMilliseconds(100);
- // Make such a large drop in bitrate that should be treated as network
- // degradation.
- constexpr int kAckedBitrate = kInitialBitrate * 3 / 4 / kFractionAfterOveruse;
- UpdateRateControl(states, BandwidthUsage::kBwOverusing, kAckedBitrate,
- states.simulated_clock->TimeInMilliseconds());
- EXPECT_EQ(kMinBwePeriodMs,
- states.aimd_rate_control->GetExpectedBandwidthPeriodMs());
-}
-
TEST(AimdRateControlTest, BandwidthPeriodIsNotBelowMin) {
auto states = CreateAimdRateControlStates();
constexpr int kInitialBitrate = 10000;
@@ -182,12 +167,12 @@ TEST(AimdRateControlTest, BandwidthPeriodIsNotBelowMin) {
TEST(AimdRateControlTest, BandwidthPeriodIsNotAboveMax) {
auto states = CreateAimdRateControlStates();
- constexpr int kInitialBitrate = 50000000;
+ constexpr int kInitialBitrate = 10010000;
states.aimd_rate_control->SetEstimate(
kInitialBitrate, states.simulated_clock->TimeInMilliseconds());
states.simulated_clock->AdvanceTimeMilliseconds(100);
// Make a large (10 Mbps) bitrate drop to 10 kbps.
- constexpr int kAckedBitrate = 40000000 / kFractionAfterOveruse;
+ constexpr int kAckedBitrate = 10000 / kFractionAfterOveruse;
UpdateRateControl(states, BandwidthUsage::kBwOverusing, kAckedBitrate,
states.simulated_clock->TimeInMilliseconds());
EXPECT_EQ(kMaxBwePeriodMs,
« no previous file with comments | « modules/remote_bitrate_estimator/aimd_rate_control.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698