Propagating total_bitrate_bps from BitrateAllocator to ProbeController, part 3.

Trigger on total bitrate change.

Bug: webrtc:8955
Change-Id: I2373a1b7f139c7ea748a9641593e714d6895c8f6
Reviewed-on: https://webrtc-review.googlesource.com/59323
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22323}
This commit is contained in:
philipel
2018-03-06 18:29:22 +01:00
committed by Commit Bot
parent 7dbb701076
commit db4fa4b944
15 changed files with 85 additions and 4 deletions

View File

@ -45,6 +45,7 @@ class LegacyProbeControllerTest : public ::testing::Test {
}
~LegacyProbeControllerTest() override {}
const int64_t kMbpsMultiplier = 1000000;
SimulatedClock clock_;
NiceMock<MockPacedSender> pacer_;
std::unique_ptr<ProbeController> probe_controller_;
@ -253,7 +254,6 @@ TEST_F(LegacyProbeControllerTest, PeriodicProbingAfterReset) {
}
TEST_F(LegacyProbeControllerTest, TestExponentialProbingOverflow) {
const int64_t kMbpsMultiplier = 1000000;
probe_controller_->SetBitrates(kMinBitrateBps, 10 * kMbpsMultiplier,
100 * kMbpsMultiplier);
@ -267,5 +267,23 @@ TEST_F(LegacyProbeControllerTest, TestExponentialProbingOverflow) {
probe_controller_->SetEstimatedBitrate(100 * kMbpsMultiplier);
}
TEST_F(LegacyProbeControllerTest, TotalBitrateProbing) {
probe_controller_->SetBitrates(kMinBitrateBps, 1 * kMbpsMultiplier,
2 * kMbpsMultiplier);
EXPECT_CALL(pacer_, CreateProbeCluster(1 * kMbpsMultiplier));
probe_controller_->SetEstimatedBitrate(500000);
probe_controller_->OnMaxTotalAllocatedBitrate(1 * kMbpsMultiplier);
}
TEST_F(LegacyProbeControllerTest, TotalBitrateNoProbing) {
probe_controller_->SetBitrates(kMinBitrateBps, 1 * kMbpsMultiplier,
2 * kMbpsMultiplier);
EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(0);
probe_controller_->SetEstimatedBitrate(500000);
probe_controller_->OnMaxTotalAllocatedBitrate(250000);
}
} // namespace test
} // namespace webrtc