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

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

Issue 2609113003: BitrateProber::CreateProbeCluster now only accept one parameter (bitrate_bps). (Closed)
Patch Set: static_cast<int> + PacedSenderTest fix. Created 3 years, 11 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.h » ('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 02d83905fd7269a10f02309e9532772c8f1b8bfd..fd6ecc137fb75373647738079aed41014c61d8b1 100644
--- a/webrtc/modules/congestion_controller/probe_controller_unittest.cc
+++ b/webrtc/modules/congestion_controller/probe_controller_unittest.cc
@@ -49,24 +49,24 @@ class ProbeControllerTest : public ::testing::Test {
};
TEST_F(ProbeControllerTest, InitiatesProbingAtStart) {
- EXPECT_CALL(pacer_, CreateProbeCluster(_, _)).Times(AtLeast(2));
+ EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(AtLeast(2));
probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
kMaxBitrateBps);
}
TEST_F(ProbeControllerTest, ProbeOnlyWhenNetworkIsUp) {
probe_controller_->OnNetworkStateChanged(kNetworkDown);
- EXPECT_CALL(pacer_, CreateProbeCluster(_, _)).Times(0);
+ EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(0);
probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
kMaxBitrateBps);
testing::Mock::VerifyAndClearExpectations(&pacer_);
- EXPECT_CALL(pacer_, CreateProbeCluster(_, _)).Times(AtLeast(2));
+ EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(AtLeast(2));
probe_controller_->OnNetworkStateChanged(kNetworkUp);
}
TEST_F(ProbeControllerTest, InitiatesProbingOnMaxBitrateIncrease) {
- EXPECT_CALL(pacer_, CreateProbeCluster(_, _)).Times(AtLeast(2));
+ EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(AtLeast(2));
probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
kMaxBitrateBps);
// Long enough to time out exponential probing.
@@ -74,7 +74,7 @@ TEST_F(ProbeControllerTest, InitiatesProbingOnMaxBitrateIncrease) {
probe_controller_->SetEstimatedBitrate(kStartBitrateBps);
probe_controller_->Process();
- EXPECT_CALL(pacer_, CreateProbeCluster(kMaxBitrateBps + 100, _));
+ EXPECT_CALL(pacer_, CreateProbeCluster(kMaxBitrateBps + 100));
probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
kMaxBitrateBps + 100);
}
@@ -85,11 +85,11 @@ TEST_F(ProbeControllerTest, TestExponentialProbing) {
// Repeated probe should only be sent when estimated bitrate climbs above
// 0.7 * 6 * kStartBitrateBps = 1260.
- EXPECT_CALL(pacer_, CreateProbeCluster(_, _)).Times(0);
+ EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(0);
probe_controller_->SetEstimatedBitrate(1000);
testing::Mock::VerifyAndClearExpectations(&pacer_);
- EXPECT_CALL(pacer_, CreateProbeCluster(2 * 1800, _));
+ EXPECT_CALL(pacer_, CreateProbeCluster(2 * 1800));
probe_controller_->SetEstimatedBitrate(1800);
}
@@ -101,12 +101,12 @@ TEST_F(ProbeControllerTest, TestExponentialProbingTimeout) {
clock_.AdvanceTimeMilliseconds(kExponentialProbingTimeoutMs);
probe_controller_->Process();
- EXPECT_CALL(pacer_, CreateProbeCluster(_, _)).Times(0);
+ EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(0);
probe_controller_->SetEstimatedBitrate(1800);
}
TEST_F(ProbeControllerTest, ProbeAfterEstimateDropInAlr) {
- EXPECT_CALL(pacer_, CreateProbeCluster(_, _)).Times(2);
+ EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(2);
probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
kMaxBitrateBps);
probe_controller_->SetEstimatedBitrate(500);
@@ -114,7 +114,7 @@ TEST_F(ProbeControllerTest, ProbeAfterEstimateDropInAlr) {
// When bandwidth estimate drops the controller should send a probe at the
// previous bitrate.
- EXPECT_CALL(pacer_, CreateProbeCluster(500, _)).Times(1);
+ EXPECT_CALL(pacer_, CreateProbeCluster(500)).Times(1);
EXPECT_CALL(pacer_, GetApplicationLimitedRegionStartTime())
.WillRepeatedly(
Return(rtc::Optional<int64_t>(clock_.TimeInMilliseconds())));
@@ -124,7 +124,7 @@ TEST_F(ProbeControllerTest, ProbeAfterEstimateDropInAlr) {
}
TEST_F(ProbeControllerTest, PeriodicProbing) {
- EXPECT_CALL(pacer_, CreateProbeCluster(_, _)).Times(2);
+ EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(2);
probe_controller_->EnablePeriodicAlrProbing(true);
probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
kMaxBitrateBps);
@@ -134,7 +134,7 @@ TEST_F(ProbeControllerTest, PeriodicProbing) {
int64_t start_time = clock_.TimeInMilliseconds();
// Expect the controller to send a new probe after 5s has passed.
- EXPECT_CALL(pacer_, CreateProbeCluster(1000, _)).Times(1);
+ EXPECT_CALL(pacer_, CreateProbeCluster(1000)).Times(1);
EXPECT_CALL(pacer_, GetApplicationLimitedRegionStartTime())
.WillRepeatedly(Return(rtc::Optional<int64_t>(start_time)));
clock_.AdvanceTimeMilliseconds(5000);
@@ -143,7 +143,7 @@ TEST_F(ProbeControllerTest, PeriodicProbing) {
testing::Mock::VerifyAndClearExpectations(&pacer_);
// The following probe should be sent at 10s into ALR.
- EXPECT_CALL(pacer_, CreateProbeCluster(_, _)).Times(0);
+ EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(0);
EXPECT_CALL(pacer_, GetApplicationLimitedRegionStartTime())
.WillRepeatedly(Return(rtc::Optional<int64_t>(start_time)));
clock_.AdvanceTimeMilliseconds(4000);
@@ -151,7 +151,7 @@ TEST_F(ProbeControllerTest, PeriodicProbing) {
probe_controller_->SetEstimatedBitrate(500);
testing::Mock::VerifyAndClearExpectations(&pacer_);
- EXPECT_CALL(pacer_, CreateProbeCluster(_, _)).Times(1);
+ EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(1);
EXPECT_CALL(pacer_, GetApplicationLimitedRegionStartTime())
.WillRepeatedly(Return(rtc::Optional<int64_t>(start_time)));
clock_.AdvanceTimeMilliseconds(1000);
@@ -166,12 +166,12 @@ TEST_F(ProbeControllerTest, TestExponentialProbingOverflow) {
100 * kMbpsMultiplier);
// Verify that probe bitrate is capped at the specified max bitrate
- EXPECT_CALL(pacer_, CreateProbeCluster(100 * kMbpsMultiplier, _));
+ EXPECT_CALL(pacer_, CreateProbeCluster(100 * kMbpsMultiplier));
probe_controller_->SetEstimatedBitrate(60 * kMbpsMultiplier);
testing::Mock::VerifyAndClearExpectations(&pacer_);
// Verify that repeated probes aren't sent.
- EXPECT_CALL(pacer_, CreateProbeCluster(_, _)).Times(0);
+ EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(0);
probe_controller_->SetEstimatedBitrate(100 * kMbpsMultiplier);
}
« no previous file with comments | « webrtc/modules/congestion_controller/probe_controller.cc ('k') | webrtc/modules/pacing/bitrate_prober.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698