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

Unified Diff: webrtc/modules/congestion_controller/probe_controller_unittest.cc

Issue 2546613003: Fix exponential probing in ProbeController. (Closed)
Patch Set: Created 4 years 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 | « webrtc/modules/congestion_controller/probe_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/congestion_controller/probe_controller_unittest.cc
diff --git a/webrtc/modules/congestion_controller/probe_controller_unittest.cc b/webrtc/modules/congestion_controller/probe_controller_unittest.cc
index 3c43cfebbbb89f2929c1c9c22c79ae2b4ad69c87..61ca559a5364ae928ff5d8d023700f0d052e4671 100644
--- a/webrtc/modules/congestion_controller/probe_controller_unittest.cc
+++ b/webrtc/modules/congestion_controller/probe_controller_unittest.cc
@@ -72,6 +72,7 @@ TEST_F(ProbeControllerTest, InitiatesProbingOnMaxBitrateIncrease) {
// Long enough to time out exponential probing.
clock_.AdvanceTimeMilliseconds(kExponentialProbingTimeoutMs);
probe_controller_->SetEstimatedBitrate(kStartBitrateBps);
+ probe_controller_->Process();
EXPECT_CALL(pacer_, CreateProbeCluster(kMaxBitrateBps + 100, _));
probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
@@ -82,6 +83,12 @@ TEST_F(ProbeControllerTest, TestExponentialProbing) {
probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
kMaxBitrateBps);
+ // Repeated probe should only be sent when estimated bitrate climbs above 4 *
+ // kStartBitrateBps = 1200.
+ EXPECT_CALL(pacer_, CreateProbeCluster(_, _)).Times(0);
+ probe_controller_->SetEstimatedBitrate(1000);
+ testing::Mock::VerifyAndClearExpectations(&pacer_);
+
EXPECT_CALL(pacer_, CreateProbeCluster(2 * 1800, _));
probe_controller_->SetEstimatedBitrate(1800);
}
@@ -92,7 +99,9 @@ TEST_F(ProbeControllerTest, TestExponentialProbingTimeout) {
// Advance far enough to cause a time out in waiting for probing result.
clock_.AdvanceTimeMilliseconds(kExponentialProbingTimeoutMs);
- EXPECT_CALL(pacer_, CreateProbeCluster(2 * 1800, _)).Times(0);
+ probe_controller_->Process();
+
+ EXPECT_CALL(pacer_, CreateProbeCluster(_, _)).Times(0);
probe_controller_->SetEstimatedBitrate(1800);
}
@@ -110,6 +119,7 @@ TEST_F(ProbeControllerTest, ProbeAfterEstimateDropInAlr) {
.WillRepeatedly(
Return(rtc::Optional<int64_t>(clock_.TimeInMilliseconds())));
clock_.AdvanceTimeMilliseconds(kAlrProbeInterval + 1);
+ probe_controller_->Process();
probe_controller_->SetEstimatedBitrate(50);
}
« no previous file with comments | « webrtc/modules/congestion_controller/probe_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698