Don't initiate perodic probing if we don't have a bandwidth estimate.

BUG=webrtc:7582

Review-Url: https://codereview.webrtc.org/2861673006
Cr-Commit-Position: refs/heads/master@{#18018}
This commit is contained in:
philipel
2017-05-04 08:35:52 -07:00
committed by Commit bot
parent 51f083ccb2
commit d1d247fa3c
3 changed files with 34 additions and 3 deletions

View File

@ -175,6 +175,34 @@ TEST_F(ProbeControllerTest, PeriodicProbing) {
testing::Mock::VerifyAndClearExpectations(&pacer_);
}
TEST_F(ProbeControllerTest, PeriodicProbingAfterReset) {
testing::StrictMock<MockPacedSender> local_pacer;
probe_controller_.reset(new ProbeController(&local_pacer, &clock_));
int64_t alr_start_time = clock_.TimeInMilliseconds();
EXPECT_CALL(local_pacer, GetApplicationLimitedRegionStartTime())
.WillRepeatedly(
Return(rtc::Optional<int64_t>(alr_start_time)));
EXPECT_CALL(local_pacer, CreateProbeCluster(_)).Times(2);
probe_controller_->EnablePeriodicAlrProbing(true);
probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
kMaxBitrateBps);
probe_controller_->Reset();
clock_.AdvanceTimeMilliseconds(10000);
probe_controller_->Process();
EXPECT_CALL(local_pacer, CreateProbeCluster(_)).Times(2);
probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
kMaxBitrateBps);
// Make sure we use |kStartBitrateBps| as the estimated bitrate
// until SetEstimatedBitrate is called with an updated estimate.
clock_.AdvanceTimeMilliseconds(10000);
EXPECT_CALL(local_pacer, CreateProbeCluster(kStartBitrateBps*2));
probe_controller_->Process();
}
TEST_F(ProbeControllerTest, TestExponentialProbingOverflow) {
const int64_t kMbpsMultiplier = 1000000;
probe_controller_->SetBitrates(kMinBitrateBps, 10 * kMbpsMultiplier,