Add FieldTrial to only send probes on OnMaxTotalAllocatedBitrate()

if currently sent bitrate is application-limited.

Bug: chromium:951299
Change-Id: Ibc1ebd74eaa4a019dc290c11b606796c5be21d0f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131126
Commit-Queue: Konrad Hofbauer <hofbauer@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27539}
This commit is contained in:
Konrad Hofbauer
2019-04-10 12:38:06 +02:00
committed by Commit Bot
parent dd33d8ec71
commit 25f35a8fa5
3 changed files with 40 additions and 1 deletions

View File

@ -95,6 +95,32 @@ TEST_F(ProbeControllerTest, InitiatesProbingOnMaxBitrateIncrease) {
EXPECT_EQ(probes[0].target_data_rate.bps(), kMaxBitrateBps + 100);
}
TEST_F(ProbeControllerTest, ProbesOnMaxBitrateIncreaseOnlyWhenInAlr) {
test::ScopedFieldTrials trials("WebRTC-BweAllocProbingOnlyInAlr/Enabled/");
probe_controller_.reset(
new ProbeController(&field_trial_config_, &mock_rtc_event_log));
auto probes = probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
kMaxBitrateBps, NowMs());
probes = probe_controller_->SetEstimatedBitrate(kMaxBitrateBps - 1, NowMs());
// Wait long enough to time out exponential probing.
clock_.AdvanceTimeMilliseconds(kExponentialProbingTimeoutMs);
probes = probe_controller_->Process(NowMs());
EXPECT_EQ(probes.size(), 0u);
// Probe when in alr.
probe_controller_->SetAlrStartTimeMs(clock_.TimeInMilliseconds());
probes = probe_controller_->OnMaxTotalAllocatedBitrate(kMaxBitrateBps + 1,
NowMs());
EXPECT_EQ(probes.size(), 2u);
// Do not probe when not in alr.
probe_controller_->SetAlrStartTimeMs(absl::nullopt);
probes = probe_controller_->OnMaxTotalAllocatedBitrate(kMaxBitrateBps + 2,
NowMs());
EXPECT_TRUE(probes.empty());
}
TEST_F(ProbeControllerTest, InitiatesProbingOnMaxBitrateIncreaseAtMaxBitrate) {
auto probes = probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
kMaxBitrateBps, NowMs());