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); |
} |