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

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

Issue 2861673006: Don't initiate perodic probing if we don't have a bandwidth estimate. (Closed)
Patch Set: Feedback Created 3 years, 7 months 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') | webrtc/modules/pacing/bitrate_prober.cc » ('j') | 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 19a9039adafa111aee4591281b978f09ce80d915..4ed2deeed1fe06813b2c9971a7581cd9681320f1 100644
--- a/webrtc/modules/congestion_controller/probe_controller_unittest.cc
+++ b/webrtc/modules/congestion_controller/probe_controller_unittest.cc
@@ -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,
« no previous file with comments | « webrtc/modules/congestion_controller/probe_controller.cc ('k') | webrtc/modules/pacing/bitrate_prober.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698