Added unit tests for new congestion controller.
This CL activates unit tests for the task queue based send side
congestion controller that will replace the current one in the future.
To be able to have the tests run side by side with the tests of the old
congestion controller, the old tests have been prefixed with "Legacy".
This CL also contains some minor fixes to the new congestion controller
code.
Bug: webrtc:8415
Change-Id: I5e7474d42f17fcbfef402e26f638846fa3424695
Reviewed-on: https://webrtc-review.googlesource.com/55381
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22229}
diff --git a/modules/congestion_controller/BUILD.gn b/modules/congestion_controller/BUILD.gn
index bcf66a9..e55a9f1 100644
--- a/modules/congestion_controller/BUILD.gn
+++ b/modules/congestion_controller/BUILD.gn
@@ -182,6 +182,7 @@
"../pacing:pacing",
"../remote_bitrate_estimator:remote_bitrate_estimator",
"../rtp_rtcp:rtp_rtcp_format",
+ "rtp:congestion_controller_unittests",
]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
diff --git a/modules/congestion_controller/acknowledged_bitrate_estimator_unittest.cc b/modules/congestion_controller/acknowledged_bitrate_estimator_unittest.cc
index d7bf736..e79895d 100644
--- a/modules/congestion_controller/acknowledged_bitrate_estimator_unittest.cc
+++ b/modules/congestion_controller/acknowledged_bitrate_estimator_unittest.cc
@@ -68,7 +68,8 @@
} // anonymous namespace
-TEST(TestAcknowledgedBitrateEstimator, DontAddPacketsWhichAreNotInSendHistory) {
+TEST(LegacyTestAcknowledgedBitrateEstimator,
+ DontAddPacketsWhichAreNotInSendHistory) {
auto states = CreateTestStates();
std::vector<PacketFeedback> packet_feedback_vector;
packet_feedback_vector.push_back(
@@ -78,7 +79,7 @@
packet_feedback_vector);
}
-TEST(TestAcknowledgedBitrateEstimator, UpdateBandwith) {
+TEST(LegacyTestAcknowledgedBitrateEstimator, UpdateBandwith) {
auto states = CreateTestStates();
auto packet_feedback_vector = CreateFeedbackVector();
{
@@ -98,7 +99,7 @@
packet_feedback_vector);
}
-TEST(TestAcknowledgedBitrateEstimator, ExpectFastRateChangeWhenLeftAlr) {
+TEST(LegacyTestAcknowledgedBitrateEstimator, ExpectFastRateChangeWhenLeftAlr) {
auto states = CreateTestStates();
auto packet_feedback_vector = CreateFeedbackVector();
{
@@ -122,7 +123,7 @@
packet_feedback_vector);
}
-TEST(TestAcknowledgedBitrateEstimator, ReturnBitrate) {
+TEST(LegacyTestAcknowledgedBitrateEstimator, ReturnBitrate) {
auto states = CreateTestStates();
rtc::Optional<uint32_t> return_value(42);
EXPECT_CALL(*states.mock_bitrate_estimator, bitrate_bps())
diff --git a/modules/congestion_controller/delay_based_bwe_unittest.cc b/modules/congestion_controller/delay_based_bwe_unittest.cc
index 250cb03..f7b0c74 100644
--- a/modules/congestion_controller/delay_based_bwe_unittest.cc
+++ b/modules/congestion_controller/delay_based_bwe_unittest.cc
@@ -26,13 +26,13 @@
constexpr float kTargetUtilizationFraction = 0.95f;
} // namespace
-TEST_F(DelayBasedBweTest, NoCrashEmptyFeedback) {
+TEST_F(LegacyDelayBasedBweTest, NoCrashEmptyFeedback) {
std::vector<PacketFeedback> packet_feedback_vector;
bitrate_estimator_->IncomingPacketFeedbackVector(packet_feedback_vector,
rtc::nullopt);
}
-TEST_F(DelayBasedBweTest, NoCrashOnlyLostFeedback) {
+TEST_F(LegacyDelayBasedBweTest, NoCrashOnlyLostFeedback) {
std::vector<PacketFeedback> packet_feedback_vector;
packet_feedback_vector.push_back(PacketFeedback(PacketFeedback::kNotReceived,
PacketFeedback::kNoSendTime,
@@ -44,7 +44,7 @@
rtc::nullopt);
}
-TEST_F(DelayBasedBweTest, ProbeDetection) {
+TEST_F(LegacyDelayBasedBweTest, ProbeDetection) {
int64_t now_ms = clock_.TimeInMilliseconds();
uint16_t seq_num = 0;
@@ -67,7 +67,7 @@
EXPECT_GT(bitrate_observer_.latest_bitrate(), 1500000u);
}
-TEST_F(DelayBasedBweTest, ProbeDetectionNonPacedPackets) {
+TEST_F(LegacyDelayBasedBweTest, ProbeDetectionNonPacedPackets) {
int64_t now_ms = clock_.TimeInMilliseconds();
uint16_t seq_num = 0;
// First burst sent at 8 * 1000 / 10 = 800 kbps, but with every other packet
@@ -85,7 +85,7 @@
EXPECT_GT(bitrate_observer_.latest_bitrate(), 800000u);
}
-TEST_F(DelayBasedBweTest, ProbeDetectionFasterArrival) {
+TEST_F(LegacyDelayBasedBweTest, ProbeDetectionFasterArrival) {
int64_t now_ms = clock_.TimeInMilliseconds();
uint16_t seq_num = 0;
// First burst sent at 8 * 1000 / 10 = 800 kbps.
@@ -101,7 +101,7 @@
EXPECT_FALSE(bitrate_observer_.updated());
}
-TEST_F(DelayBasedBweTest, ProbeDetectionSlowerArrival) {
+TEST_F(LegacyDelayBasedBweTest, ProbeDetectionSlowerArrival) {
int64_t now_ms = clock_.TimeInMilliseconds();
uint16_t seq_num = 0;
// First burst sent at 8 * 1000 / 5 = 1600 kbps.
@@ -121,7 +121,7 @@
kTargetUtilizationFraction * 1140000u, 10000u);
}
-TEST_F(DelayBasedBweTest, ProbeDetectionSlowerArrivalHighBitrate) {
+TEST_F(LegacyDelayBasedBweTest, ProbeDetectionSlowerArrivalHighBitrate) {
int64_t now_ms = clock_.TimeInMilliseconds();
uint16_t seq_num = 0;
// Burst sent at 8 * 1000 / 1 = 8000 kbps.
@@ -141,7 +141,7 @@
kTargetUtilizationFraction * 4000000u, 10000u);
}
-TEST_F(DelayBasedBweTest, GetExpectedBwePeriodMs) {
+TEST_F(LegacyDelayBasedBweTest, GetExpectedBwePeriodMs) {
int64_t default_interval_ms = bitrate_estimator_->GetExpectedBwePeriodMs();
EXPECT_GT(default_interval_ms, 0);
CapacityDropTestHelper(1, true, 333, 0);
@@ -150,45 +150,45 @@
EXPECT_NE(interval_ms, default_interval_ms);
}
-TEST_F(DelayBasedBweTest, InitialBehavior) {
+TEST_F(LegacyDelayBasedBweTest, InitialBehavior) {
InitialBehaviorTestHelper(730000);
}
-TEST_F(DelayBasedBweTest, RateIncreaseReordering) {
+TEST_F(LegacyDelayBasedBweTest, RateIncreaseReordering) {
RateIncreaseReorderingTestHelper(730000);
}
-TEST_F(DelayBasedBweTest, RateIncreaseRtpTimestamps) {
+TEST_F(LegacyDelayBasedBweTest, RateIncreaseRtpTimestamps) {
RateIncreaseRtpTimestampsTestHelper(627);
}
-TEST_F(DelayBasedBweTest, CapacityDropOneStream) {
+TEST_F(LegacyDelayBasedBweTest, CapacityDropOneStream) {
CapacityDropTestHelper(1, false, 300, 0);
}
-TEST_F(DelayBasedBweTest, CapacityDropPosOffsetChange) {
+TEST_F(LegacyDelayBasedBweTest, CapacityDropPosOffsetChange) {
CapacityDropTestHelper(1, false, 867, 30000);
}
-TEST_F(DelayBasedBweTest, CapacityDropNegOffsetChange) {
+TEST_F(LegacyDelayBasedBweTest, CapacityDropNegOffsetChange) {
CapacityDropTestHelper(1, false, 933, -30000);
}
-TEST_F(DelayBasedBweTest, CapacityDropOneStreamWrap) {
+TEST_F(LegacyDelayBasedBweTest, CapacityDropOneStreamWrap) {
CapacityDropTestHelper(1, true, 333, 0);
}
-TEST_F(DelayBasedBweTest, TestTimestampGrouping) {
+TEST_F(LegacyDelayBasedBweTest, TestTimestampGrouping) {
TestTimestampGroupingTestHelper();
}
-TEST_F(DelayBasedBweTest, TestShortTimeoutAndWrap) {
+TEST_F(LegacyDelayBasedBweTest, TestShortTimeoutAndWrap) {
// Simulate a client leaving and rejoining the call after 35 seconds. This
// will make abs send time wrap, so if streams aren't timed out properly
// the next 30 seconds of packets will be out of order.
TestWrappingHelper(35);
}
-TEST_F(DelayBasedBweTest, TestLongTimeoutAndWrap) {
+TEST_F(LegacyDelayBasedBweTest, TestLongTimeoutAndWrap) {
// Simulate a client leaving and rejoining the call after some multiple of
// 64 seconds later. This will cause a zero difference in abs send times due
// to the wrap, but a big difference in arrival time, if streams aren't
@@ -196,7 +196,7 @@
TestWrappingHelper(10 * 64);
}
-TEST_F(DelayBasedBweTest, TestInitialOveruse) {
+TEST_F(LegacyDelayBasedBweTest, TestInitialOveruse) {
const uint32_t kStartBitrate = 300e3;
const uint32_t kInitialCapacityBps = 200e3;
const uint32_t kDummySsrc = 0;
diff --git a/modules/congestion_controller/delay_based_bwe_unittest_helper.cc b/modules/congestion_controller/delay_based_bwe_unittest_helper.cc
index b441e99..3e89f06 100644
--- a/modules/congestion_controller/delay_based_bwe_unittest_helper.cc
+++ b/modules/congestion_controller/delay_based_bwe_unittest_helper.cc
@@ -148,7 +148,7 @@
}
} // namespace test
-DelayBasedBweTest::DelayBasedBweTest()
+LegacyDelayBasedBweTest::LegacyDelayBasedBweTest()
: clock_(100000000),
acknowledged_bitrate_estimator_(
rtc::MakeUnique<AcknowledgedBitrateEstimator>()),
@@ -158,27 +158,28 @@
arrival_time_offset_ms_(0),
first_update_(true) {}
-DelayBasedBweTest::~DelayBasedBweTest() {}
+LegacyDelayBasedBweTest::~LegacyDelayBasedBweTest() {}
-void DelayBasedBweTest::AddDefaultStream() {
+void LegacyDelayBasedBweTest::AddDefaultStream() {
stream_generator_->AddStream(new test::RtpStream(30, 3e5));
}
-const uint32_t DelayBasedBweTest::kDefaultSsrc = 0;
+const uint32_t LegacyDelayBasedBweTest::kDefaultSsrc = 0;
-void DelayBasedBweTest::IncomingFeedback(int64_t arrival_time_ms,
- int64_t send_time_ms,
- uint16_t sequence_number,
- size_t payload_size) {
+void LegacyDelayBasedBweTest::IncomingFeedback(int64_t arrival_time_ms,
+ int64_t send_time_ms,
+ uint16_t sequence_number,
+ size_t payload_size) {
IncomingFeedback(arrival_time_ms, send_time_ms, sequence_number, payload_size,
PacedPacketInfo());
}
-void DelayBasedBweTest::IncomingFeedback(int64_t arrival_time_ms,
- int64_t send_time_ms,
- uint16_t sequence_number,
- size_t payload_size,
- const PacedPacketInfo& pacing_info) {
+void LegacyDelayBasedBweTest::IncomingFeedback(
+ int64_t arrival_time_ms,
+ int64_t send_time_ms,
+ uint16_t sequence_number,
+ size_t payload_size,
+ const PacedPacketInfo& pacing_info) {
RTC_CHECK_GE(arrival_time_ms + arrival_time_offset_ms_, 0);
PacketFeedback packet(arrival_time_ms + arrival_time_offset_ms_, send_time_ms,
sequence_number, payload_size, pacing_info);
@@ -201,8 +202,8 @@
// Returns true if an over-use was seen, false otherwise.
// The StreamGenerator::updated() should be used to check for any changes in
// target bitrate after the call to this function.
-bool DelayBasedBweTest::GenerateAndProcessFrame(uint32_t ssrc,
- uint32_t bitrate_bps) {
+bool LegacyDelayBasedBweTest::GenerateAndProcessFrame(uint32_t ssrc,
+ uint32_t bitrate_bps) {
stream_generator_->SetBitrateBps(bitrate_bps);
std::vector<PacketFeedback> packets;
int64_t next_time_us =
@@ -240,12 +241,12 @@
// until it reaches |target_bitrate|.
// Can for instance be used to run the estimator for some time to get it
// into a steady state.
-uint32_t DelayBasedBweTest::SteadyStateRun(uint32_t ssrc,
- int max_number_of_frames,
- uint32_t start_bitrate,
- uint32_t min_bitrate,
- uint32_t max_bitrate,
- uint32_t target_bitrate) {
+uint32_t LegacyDelayBasedBweTest::SteadyStateRun(uint32_t ssrc,
+ int max_number_of_frames,
+ uint32_t start_bitrate,
+ uint32_t min_bitrate,
+ uint32_t max_bitrate,
+ uint32_t target_bitrate) {
uint32_t bitrate_bps = start_bitrate;
bool bitrate_update_seen = false;
// Produce |number_of_frames| frames and give them to the estimator.
@@ -268,7 +269,7 @@
return bitrate_bps;
}
-void DelayBasedBweTest::InitialBehaviorTestHelper(
+void LegacyDelayBasedBweTest::InitialBehaviorTestHelper(
uint32_t expected_converge_bitrate) {
const int kFramerate = 50; // 50 fps to avoid rounding errors.
const int kFrameIntervalMs = 1000 / kFramerate;
@@ -311,7 +312,7 @@
EXPECT_EQ(bitrate_observer_.latest_bitrate(), bitrate_bps);
}
-void DelayBasedBweTest::RateIncreaseReorderingTestHelper(
+void LegacyDelayBasedBweTest::RateIncreaseReorderingTestHelper(
uint32_t expected_bitrate_bps) {
const int kFramerate = 50; // 50 fps to avoid rounding errors.
const int kFrameIntervalMs = 1000 / kFramerate;
@@ -356,7 +357,7 @@
}
// Make sure we initially increase the bitrate as expected.
-void DelayBasedBweTest::RateIncreaseRtpTimestampsTestHelper(
+void LegacyDelayBasedBweTest::RateIncreaseRtpTimestampsTestHelper(
int expected_iterations) {
// This threshold corresponds approximately to increasing linearly with
// bitrate(i) = 1.04 * bitrate(i-1) + 1000
@@ -381,7 +382,7 @@
ASSERT_EQ(expected_iterations, iterations);
}
-void DelayBasedBweTest::CapacityDropTestHelper(
+void LegacyDelayBasedBweTest::CapacityDropTestHelper(
int number_of_streams,
bool wrap_time_stamp,
uint32_t expected_bitrate_drop_delta,
@@ -443,7 +444,7 @@
bitrate_drop_time - overuse_start_time, 33);
}
-void DelayBasedBweTest::TestTimestampGroupingTestHelper() {
+void LegacyDelayBasedBweTest::TestTimestampGroupingTestHelper() {
const int kFramerate = 50; // 50 fps to avoid rounding errors.
const int kFrameIntervalMs = 1000 / kFramerate;
int64_t send_time_ms = 0;
@@ -481,7 +482,7 @@
EXPECT_LT(bitrate_observer_.latest_bitrate(), 400000u);
}
-void DelayBasedBweTest::TestWrappingHelper(int silence_time_s) {
+void LegacyDelayBasedBweTest::TestWrappingHelper(int silence_time_s) {
const int kFramerate = 100;
const int kFrameIntervalMs = 1000 / kFramerate;
int64_t send_time_ms = 0;
diff --git a/modules/congestion_controller/delay_based_bwe_unittest_helper.h b/modules/congestion_controller/delay_based_bwe_unittest_helper.h
index 23969a9..3e7cbaa 100644
--- a/modules/congestion_controller/delay_based_bwe_unittest_helper.h
+++ b/modules/congestion_controller/delay_based_bwe_unittest_helper.h
@@ -111,10 +111,10 @@
};
} // namespace test
-class DelayBasedBweTest : public ::testing::Test {
+class LegacyDelayBasedBweTest : public ::testing::Test {
public:
- DelayBasedBweTest();
- virtual ~DelayBasedBweTest();
+ LegacyDelayBasedBweTest();
+ virtual ~LegacyDelayBasedBweTest();
protected:
void AddDefaultStream();
@@ -171,7 +171,7 @@
int64_t arrival_time_offset_ms_;
bool first_update_;
- RTC_DISALLOW_COPY_AND_ASSIGN(DelayBasedBweTest);
+ RTC_DISALLOW_COPY_AND_ASSIGN(LegacyDelayBasedBweTest);
};
} // namespace webrtc
diff --git a/modules/congestion_controller/median_slope_estimator_unittest.cc b/modules/congestion_controller/median_slope_estimator_unittest.cc
index a5b90d8..953f8e1 100644
--- a/modules/congestion_controller/median_slope_estimator_unittest.cc
+++ b/modules/congestion_controller/median_slope_estimator_unittest.cc
@@ -45,27 +45,27 @@
}
} // namespace
-TEST(MedianSlopeEstimator, PerfectLineSlopeOneHalf) {
+TEST(DeprecatedMedianSlopeEstimator, PerfectLineSlopeOneHalf) {
TestEstimator(0.5, 0, 0.001);
}
-TEST(MedianSlopeEstimator, PerfectLineSlopeMinusOne) {
+TEST(DeprecatedMedianSlopeEstimator, PerfectLineSlopeMinusOne) {
TestEstimator(-1, 0, 0.001);
}
-TEST(MedianSlopeEstimator, PerfectLineSlopeZero) {
+TEST(DeprecatedMedianSlopeEstimator, PerfectLineSlopeZero) {
TestEstimator(0, 0, 0.001);
}
-TEST(MedianSlopeEstimator, JitteryLineSlopeOneHalf) {
+TEST(DeprecatedMedianSlopeEstimator, JitteryLineSlopeOneHalf) {
TestEstimator(0.5, kAvgTimeBetweenPackets / 3.0, 0.01);
}
-TEST(MedianSlopeEstimator, JitteryLineSlopeMinusOne) {
+TEST(DeprecatedMedianSlopeEstimator, JitteryLineSlopeMinusOne) {
TestEstimator(-1, kAvgTimeBetweenPackets / 3.0, 0.05);
}
-TEST(MedianSlopeEstimator, JitteryLineSlopeZero) {
+TEST(DeprecatedMedianSlopeEstimator, JitteryLineSlopeZero) {
TestEstimator(0, kAvgTimeBetweenPackets / 3.0, 0.02);
}
diff --git a/modules/congestion_controller/probe_bitrate_estimator_unittest.cc b/modules/congestion_controller/probe_bitrate_estimator_unittest.cc
index 6d21de4..f670530 100644
--- a/modules/congestion_controller/probe_bitrate_estimator_unittest.cc
+++ b/modules/congestion_controller/probe_bitrate_estimator_unittest.cc
@@ -26,9 +26,9 @@
constexpr float kTargetUtilizationFraction = 0.95f;
} // anonymous namespace
-class TestProbeBitrateEstimator : public ::testing::Test {
+class LegacyTestProbeBitrateEstimator : public ::testing::Test {
public:
- TestProbeBitrateEstimator() : probe_bitrate_estimator_(nullptr) {}
+ LegacyTestProbeBitrateEstimator() : probe_bitrate_estimator_(nullptr) {}
// TODO(philipel): Use PacedPacketInfo when ProbeBitrateEstimator is rewritten
// to use that information.
@@ -50,7 +50,7 @@
ProbeBitrateEstimator probe_bitrate_estimator_;
};
-TEST_F(TestProbeBitrateEstimator, OneCluster) {
+TEST_F(LegacyTestProbeBitrateEstimator, OneCluster) {
AddPacketFeedback(0, 1000, 0, 10);
AddPacketFeedback(0, 1000, 10, 20);
AddPacketFeedback(0, 1000, 20, 30);
@@ -59,7 +59,7 @@
EXPECT_NEAR(measured_bps_, 800000, 10);
}
-TEST_F(TestProbeBitrateEstimator, OneClusterTooFewProbes) {
+TEST_F(LegacyTestProbeBitrateEstimator, OneClusterTooFewProbes) {
AddPacketFeedback(0, 2000, 0, 10);
AddPacketFeedback(0, 2000, 10, 20);
AddPacketFeedback(0, 2000, 20, 30);
@@ -67,7 +67,7 @@
EXPECT_EQ(kInvalidBitrate, measured_bps_);
}
-TEST_F(TestProbeBitrateEstimator, OneClusterTooFewBytes) {
+TEST_F(LegacyTestProbeBitrateEstimator, OneClusterTooFewBytes) {
const int kMinBytes = 6000;
AddPacketFeedback(0, 800, 0, 10, kDefaultMinProbes, kMinBytes);
AddPacketFeedback(0, 800, 10, 20, kDefaultMinProbes, kMinBytes);
@@ -78,7 +78,7 @@
EXPECT_EQ(kInvalidBitrate, measured_bps_);
}
-TEST_F(TestProbeBitrateEstimator, SmallCluster) {
+TEST_F(LegacyTestProbeBitrateEstimator, SmallCluster) {
const int kMinBytes = 1000;
AddPacketFeedback(0, 150, 0, 10, kDefaultMinProbes, kMinBytes);
AddPacketFeedback(0, 150, 10, 20, kDefaultMinProbes, kMinBytes);
@@ -89,7 +89,7 @@
EXPECT_NEAR(measured_bps_, 120000, 10);
}
-TEST_F(TestProbeBitrateEstimator, LargeCluster) {
+TEST_F(LegacyTestProbeBitrateEstimator, LargeCluster) {
const int kMinProbes = 30;
const int kMinBytes = 312500;
@@ -103,7 +103,7 @@
EXPECT_NEAR(measured_bps_, 100000000, 10);
}
-TEST_F(TestProbeBitrateEstimator, FastReceive) {
+TEST_F(LegacyTestProbeBitrateEstimator, FastReceive) {
AddPacketFeedback(0, 1000, 0, 15);
AddPacketFeedback(0, 1000, 10, 30);
AddPacketFeedback(0, 1000, 20, 35);
@@ -112,7 +112,7 @@
EXPECT_NEAR(measured_bps_, 800000, 10);
}
-TEST_F(TestProbeBitrateEstimator, TooFastReceive) {
+TEST_F(LegacyTestProbeBitrateEstimator, TooFastReceive) {
AddPacketFeedback(0, 1000, 0, 19);
AddPacketFeedback(0, 1000, 10, 22);
AddPacketFeedback(0, 1000, 20, 25);
@@ -121,7 +121,7 @@
EXPECT_EQ(measured_bps_, kInvalidBitrate);
}
-TEST_F(TestProbeBitrateEstimator, SlowReceive) {
+TEST_F(LegacyTestProbeBitrateEstimator, SlowReceive) {
AddPacketFeedback(0, 1000, 0, 10);
AddPacketFeedback(0, 1000, 10, 40);
AddPacketFeedback(0, 1000, 20, 70);
@@ -131,7 +131,7 @@
EXPECT_NEAR(measured_bps_, kTargetUtilizationFraction * 320000, 10);
}
-TEST_F(TestProbeBitrateEstimator, BurstReceive) {
+TEST_F(LegacyTestProbeBitrateEstimator, BurstReceive) {
AddPacketFeedback(0, 1000, 0, 50);
AddPacketFeedback(0, 1000, 10, 50);
AddPacketFeedback(0, 1000, 20, 50);
@@ -140,7 +140,7 @@
EXPECT_EQ(measured_bps_, kInvalidBitrate);
}
-TEST_F(TestProbeBitrateEstimator, MultipleClusters) {
+TEST_F(LegacyTestProbeBitrateEstimator, MultipleClusters) {
AddPacketFeedback(0, 1000, 0, 10);
AddPacketFeedback(0, 1000, 10, 20);
AddPacketFeedback(0, 1000, 20, 30);
@@ -161,7 +161,7 @@
EXPECT_NEAR(measured_bps_, kTargetUtilizationFraction * 1200000, 10);
}
-TEST_F(TestProbeBitrateEstimator, IgnoreOldClusters) {
+TEST_F(LegacyTestProbeBitrateEstimator, IgnoreOldClusters) {
AddPacketFeedback(0, 1000, 0, 10);
AddPacketFeedback(0, 1000, 10, 20);
AddPacketFeedback(0, 1000, 20, 30);
@@ -180,7 +180,7 @@
EXPECT_EQ(measured_bps_, kInvalidBitrate);
}
-TEST_F(TestProbeBitrateEstimator, IgnoreSizeLastSendPacket) {
+TEST_F(LegacyTestProbeBitrateEstimator, IgnoreSizeLastSendPacket) {
AddPacketFeedback(0, 1000, 0, 10);
AddPacketFeedback(0, 1000, 10, 20);
AddPacketFeedback(0, 1000, 20, 30);
@@ -191,7 +191,7 @@
EXPECT_NEAR(measured_bps_, 800000, 10);
}
-TEST_F(TestProbeBitrateEstimator, IgnoreSizeFirstReceivePacket) {
+TEST_F(LegacyTestProbeBitrateEstimator, IgnoreSizeFirstReceivePacket) {
AddPacketFeedback(0, 1500, 0, 10);
AddPacketFeedback(0, 1000, 10, 20);
AddPacketFeedback(0, 1000, 20, 30);
@@ -201,11 +201,11 @@
EXPECT_NEAR(measured_bps_, kTargetUtilizationFraction * 800000, 10);
}
-TEST_F(TestProbeBitrateEstimator, NoLastEstimatedBitrateBps) {
+TEST_F(LegacyTestProbeBitrateEstimator, NoLastEstimatedBitrateBps) {
EXPECT_FALSE(probe_bitrate_estimator_.FetchAndResetLastEstimatedBitrateBps());
}
-TEST_F(TestProbeBitrateEstimator, FetchLastEstimatedBitrateBps) {
+TEST_F(LegacyTestProbeBitrateEstimator, FetchLastEstimatedBitrateBps) {
AddPacketFeedback(0, 1000, 0, 10);
AddPacketFeedback(0, 1000, 10, 20);
AddPacketFeedback(0, 1000, 20, 30);
diff --git a/modules/congestion_controller/probe_controller_unittest.cc b/modules/congestion_controller/probe_controller_unittest.cc
index 3477c87..da333d3 100644
--- a/modules/congestion_controller/probe_controller_unittest.cc
+++ b/modules/congestion_controller/probe_controller_unittest.cc
@@ -38,25 +38,25 @@
} // namespace
-class ProbeControllerTest : public ::testing::Test {
+class LegacyProbeControllerTest : public ::testing::Test {
protected:
- ProbeControllerTest() : clock_(100000000L) {
+ LegacyProbeControllerTest() : clock_(100000000L) {
probe_controller_.reset(new ProbeController(&pacer_, &clock_));
}
- ~ProbeControllerTest() override {}
+ ~LegacyProbeControllerTest() override {}
SimulatedClock clock_;
NiceMock<MockPacedSender> pacer_;
std::unique_ptr<ProbeController> probe_controller_;
};
-TEST_F(ProbeControllerTest, InitiatesProbingAtStart) {
+TEST_F(LegacyProbeControllerTest, InitiatesProbingAtStart) {
EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(AtLeast(2));
probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
kMaxBitrateBps);
}
-TEST_F(ProbeControllerTest, ProbeOnlyWhenNetworkIsUp) {
+TEST_F(LegacyProbeControllerTest, ProbeOnlyWhenNetworkIsUp) {
probe_controller_->OnNetworkStateChanged(kNetworkDown);
EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(0);
probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
@@ -67,7 +67,7 @@
probe_controller_->OnNetworkStateChanged(kNetworkUp);
}
-TEST_F(ProbeControllerTest, InitiatesProbingOnMaxBitrateIncrease) {
+TEST_F(LegacyProbeControllerTest, InitiatesProbingOnMaxBitrateIncrease) {
EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(AtLeast(2));
probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
kMaxBitrateBps);
@@ -81,7 +81,8 @@
kMaxBitrateBps + 100);
}
-TEST_F(ProbeControllerTest, InitiatesProbingOnMaxBitrateIncreaseAtMaxBitrate) {
+TEST_F(LegacyProbeControllerTest,
+ InitiatesProbingOnMaxBitrateIncreaseAtMaxBitrate) {
EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(AtLeast(2));
probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
kMaxBitrateBps);
@@ -96,7 +97,7 @@
kMaxBitrateBps + 100);
}
-TEST_F(ProbeControllerTest, TestExponentialProbing) {
+TEST_F(LegacyProbeControllerTest, TestExponentialProbing) {
probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
kMaxBitrateBps);
@@ -110,7 +111,7 @@
probe_controller_->SetEstimatedBitrate(1800);
}
-TEST_F(ProbeControllerTest, TestExponentialProbingTimeout) {
+TEST_F(LegacyProbeControllerTest, TestExponentialProbingTimeout) {
probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
kMaxBitrateBps);
@@ -122,7 +123,7 @@
probe_controller_->SetEstimatedBitrate(1800);
}
-TEST_F(ProbeControllerTest, RequestProbeInAlr) {
+TEST_F(LegacyProbeControllerTest, RequestProbeInAlr) {
EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(2);
probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
kMaxBitrateBps);
@@ -137,7 +138,7 @@
probe_controller_->RequestProbe();
}
-TEST_F(ProbeControllerTest, RequestProbeWhenAlrEndedRecently) {
+TEST_F(LegacyProbeControllerTest, RequestProbeWhenAlrEndedRecently) {
EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(2);
probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
kMaxBitrateBps);
@@ -154,7 +155,7 @@
probe_controller_->RequestProbe();
}
-TEST_F(ProbeControllerTest, RequestProbeWhenAlrNotEndedRecently) {
+TEST_F(LegacyProbeControllerTest, RequestProbeWhenAlrNotEndedRecently) {
EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(2);
probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
kMaxBitrateBps);
@@ -171,7 +172,7 @@
probe_controller_->RequestProbe();
}
-TEST_F(ProbeControllerTest, RequestProbeWhenBweDropNotRecent) {
+TEST_F(LegacyProbeControllerTest, RequestProbeWhenBweDropNotRecent) {
EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(2);
probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
kMaxBitrateBps);
@@ -187,7 +188,7 @@
probe_controller_->RequestProbe();
}
-TEST_F(ProbeControllerTest, PeriodicProbing) {
+TEST_F(LegacyProbeControllerTest, PeriodicProbing) {
EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(2);
probe_controller_->EnablePeriodicAlrProbing(true);
probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
@@ -224,7 +225,7 @@
testing::Mock::VerifyAndClearExpectations(&pacer_);
}
-TEST_F(ProbeControllerTest, PeriodicProbingAfterReset) {
+TEST_F(LegacyProbeControllerTest, PeriodicProbingAfterReset) {
testing::StrictMock<MockPacedSender> local_pacer;
probe_controller_.reset(new ProbeController(&local_pacer, &clock_));
int64_t alr_start_time = clock_.TimeInMilliseconds();
@@ -251,7 +252,7 @@
probe_controller_->Process();
}
-TEST_F(ProbeControllerTest, TestExponentialProbingOverflow) {
+TEST_F(LegacyProbeControllerTest, TestExponentialProbingOverflow) {
const int64_t kMbpsMultiplier = 1000000;
probe_controller_->SetBitrates(kMinBitrateBps, 10 * kMbpsMultiplier,
100 * kMbpsMultiplier);
diff --git a/modules/congestion_controller/rtp/BUILD.gn b/modules/congestion_controller/rtp/BUILD.gn
index a75d5d4..47ae9f5 100644
--- a/modules/congestion_controller/rtp/BUILD.gn
+++ b/modules/congestion_controller/rtp/BUILD.gn
@@ -20,11 +20,9 @@
visibility = [ "*" ]
configs += [ ":bwe_test_logging" ]
sources = [
- "include/receive_side_congestion_controller.h",
"include/send_side_congestion_controller.h",
"pacer_controller.cc",
"pacer_controller.h",
- "receive_side_congestion_controller.cc",
"send_side_congestion_controller.cc",
]
@@ -39,6 +37,7 @@
deps = [
":goog_cc",
":transport_feedback",
+ "../:congestion_controller",
"../..:module_api",
"../../..:webrtc_common",
"../../../rtc_base:checks",
@@ -49,7 +48,6 @@
"../../../system_wrappers:field_trial_api",
"../../../system_wrappers:metrics_api",
"../../../system_wrappers:runtime_enabled_features_api",
- "../../bitrate_controller",
"../../pacing",
"../../remote_bitrate_estimator",
"../../rtp_rtcp:rtp_rtcp_format",
@@ -84,6 +82,7 @@
sources = [
"alr_detector.cc",
"alr_detector.h",
+ "goog_cc_factory.cc",
"goog_cc_network_control.cc",
"goog_cc_network_control.h",
"include/goog_cc_factory.h",
@@ -192,7 +191,6 @@
sources = [
"congestion_controller_unittests_helper.cc",
"congestion_controller_unittests_helper.h",
- "receive_side_congestion_controller_unittest.cc",
"send_side_congestion_controller_unittest.cc",
"send_time_history_unittest.cc",
"transport_feedback_adapter_unittest.cc",
@@ -200,8 +198,9 @@
deps = [
":congestion_controller",
":goog_cc_unittests",
- ":mock_congestion_controller",
":transport_feedback",
+ "../:congestion_controller",
+ "../:mock_congestion_controller",
"../../../logging:mocks",
"../../../rtc_base:checks",
"../../../rtc_base:rtc_base",
@@ -261,16 +260,4 @@
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
}
-
- rtc_source_set("mock_congestion_controller") {
- testonly = true
- sources = [
- "include/mock/mock_congestion_observer.h",
- "include/mock/mock_send_side_congestion_controller.h",
- ]
- deps = [
- ":congestion_controller",
- "../../../test:test_support",
- ]
- }
}
diff --git a/modules/congestion_controller/rtp/delay_based_bwe.h b/modules/congestion_controller/rtp/delay_based_bwe.h
index 43bc92b..e7dd568 100644
--- a/modules/congestion_controller/rtp/delay_based_bwe.h
+++ b/modules/congestion_controller/rtp/delay_based_bwe.h
@@ -25,7 +25,6 @@
#include "rtc_base/race_checker.h"
namespace webrtc {
-
class RtcEventLog;
namespace webrtc_cc {
diff --git a/modules/congestion_controller/rtp/goog_cc_factory.cc b/modules/congestion_controller/rtp/goog_cc_factory.cc
new file mode 100644
index 0000000..3bfb57f
--- /dev/null
+++ b/modules/congestion_controller/rtp/goog_cc_factory.cc
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include "modules/congestion_controller/rtp/include/goog_cc_factory.h"
+
+#include "modules/congestion_controller/rtp/goog_cc_network_control.h"
+#include "rtc_base/ptr_util.h"
+namespace webrtc {
+GoogCcNetworkControllerFactory::GoogCcNetworkControllerFactory(
+ RtcEventLog* event_log)
+ : event_log_(event_log) {}
+
+NetworkControllerInterface::uptr GoogCcNetworkControllerFactory::Create(
+ NetworkControllerObserver* observer) {
+ return rtc::MakeUnique<webrtc_cc::GoogCcNetworkController>(event_log_,
+ observer);
+}
+
+TimeDelta GoogCcNetworkControllerFactory::GetProcessInterval() const {
+ const int64_t kUpdateIntervalMs = 25;
+ return TimeDelta::ms(kUpdateIntervalMs);
+}
+} // namespace webrtc
diff --git a/modules/congestion_controller/rtp/goog_cc_network_control.cc b/modules/congestion_controller/rtp/goog_cc_network_control.cc
index 7627b56..ad4dfce 100644
--- a/modules/congestion_controller/rtp/goog_cc_network_control.cc
+++ b/modules/congestion_controller/rtp/goog_cc_network_control.cc
@@ -103,20 +103,6 @@
} // namespace
-GoogCcNetworkControllerFactory::GoogCcNetworkControllerFactory(
- RtcEventLog* event_log)
- : event_log_(event_log) {}
-
-NetworkControllerInterface::uptr GoogCcNetworkControllerFactory::Create(
- NetworkControllerObserver* observer) {
- return rtc::MakeUnique<GoogCcNetworkController>(event_log_, observer);
-}
-
-TimeDelta GoogCcNetworkControllerFactory::GetProcessInterval() const {
- const int64_t kUpdateIntervalMs = 25;
- return TimeDelta::ms(kUpdateIntervalMs);
-}
-
GoogCcNetworkController::GoogCcNetworkController(
RtcEventLog* event_log,
NetworkControllerObserver* observer)
diff --git a/modules/congestion_controller/rtp/include/send_side_congestion_controller.h b/modules/congestion_controller/rtp/include/send_side_congestion_controller.h
index d3a93d5..259e10a 100644
--- a/modules/congestion_controller/rtp/include/send_side_congestion_controller.h
+++ b/modules/congestion_controller/rtp/include/send_side_congestion_controller.h
@@ -18,6 +18,7 @@
#include <vector>
#include "common_types.h" // NOLINT(build/include)
+#include "modules/congestion_controller/include/network_changed_observer.h"
#include "modules/congestion_controller/rtp/network_control/include/network_control.h"
#include "modules/congestion_controller/rtp/network_control/include/network_types.h"
#include "modules/congestion_controller/rtp/pacer_controller.h"
@@ -58,23 +59,8 @@
public TransportFeedbackObserver,
public RtcpBandwidthObserver {
public:
- // Observer class for bitrate changes announced due to change in bandwidth
- // estimate or due to that the send pacer is full. Fraction loss and rtt is
- // also part of this callback to allow the observer to optimize its settings
- // for different types of network environments. The bitrate does not include
- // packet headers and is measured in bits per second.
- class Observer {
- public:
- virtual void OnNetworkChanged(uint32_t bitrate_bps,
- uint8_t fraction_loss, // 0 - 255.
- int64_t rtt_ms,
- int64_t probing_interval_ms) = 0;
-
- protected:
- virtual ~Observer() {}
- };
SendSideCongestionController(const Clock* clock,
- Observer* observer,
+ NetworkChangedObserver* observer,
RtcEventLog* event_log,
PacedSender* pacer);
~SendSideCongestionController() override;
@@ -88,8 +74,8 @@
// reference to Call, which then registers itself as the observer. We should
// try to break this circular chain of references, and make the observer a
// construction time constant.
- void RegisterNetworkObserver(Observer* observer);
- void DeRegisterNetworkObserver(Observer* observer);
+ void RegisterNetworkObserver(NetworkChangedObserver* observer);
+ void DeRegisterNetworkObserver(NetworkChangedObserver* observer);
virtual void SetBweBitrates(int min_bitrate_bps,
int start_bitrate_bps,
diff --git a/modules/congestion_controller/rtp/probe_controller_unittest.cc b/modules/congestion_controller/rtp/probe_controller_unittest.cc
index 0193747..12e341d 100644
--- a/modules/congestion_controller/rtp/probe_controller_unittest.cc
+++ b/modules/congestion_controller/rtp/probe_controller_unittest.cc
@@ -23,8 +23,6 @@
using testing::NiceMock;
using testing::Return;
-using webrtc::ProbeClusterConfig;
-
namespace webrtc {
namespace webrtc_cc {
namespace test {
diff --git a/modules/congestion_controller/rtp/send_side_congestion_controller.cc b/modules/congestion_controller/rtp/send_side_congestion_controller.cc
index b2e7069..ac81220 100644
--- a/modules/congestion_controller/rtp/send_side_congestion_controller.cc
+++ b/modules/congestion_controller/rtp/send_side_congestion_controller.cc
@@ -116,10 +116,8 @@
void OnNetworkAvailability(NetworkAvailability msg);
void OnPacerQueueUpdate(PacerQueueUpdate msg);
- void RegisterNetworkObserver(
- SendSideCongestionController::Observer* observer);
- void DeRegisterNetworkObserver(
- SendSideCongestionController::Observer* observer);
+ void RegisterNetworkObserver(NetworkChangedObserver* observer);
+ void DeRegisterNetworkObserver(NetworkChangedObserver* observer);
rtc::Optional<TargetTransferRate> last_transfer_rate();
bool pacer_configured();
@@ -142,7 +140,7 @@
RTC_GUARDED_BY(state_lock_);
bool pacer_configured_ RTC_GUARDED_BY(state_lock_) = false;
- SendSideCongestionController::Observer* observer_ = nullptr;
+ NetworkChangedObserver* observer_ = nullptr;
rtc::Optional<TargetTransferRate> current_target_rate_msg_;
bool network_available_ = true;
int64_t last_reported_target_bitrate_bps_ = 0;
@@ -204,15 +202,14 @@
OnNetworkInvalidation();
}
-void ControlHandler::RegisterNetworkObserver(
- SendSideCongestionController::Observer* observer) {
+void ControlHandler::RegisterNetworkObserver(NetworkChangedObserver* observer) {
RTC_DCHECK_CALLED_SEQUENTIALLY(&sequenced_checker_);
RTC_DCHECK(observer_ == nullptr);
observer_ = observer;
}
void ControlHandler::DeRegisterNetworkObserver(
- SendSideCongestionController::Observer* observer) {
+ NetworkChangedObserver* observer) {
RTC_DCHECK_CALLED_SEQUENTIALLY(&sequenced_checker_);
RTC_DCHECK_EQ(observer_, observer);
observer_ = nullptr;
@@ -301,7 +298,7 @@
SendSideCongestionController::SendSideCongestionController(
const Clock* clock,
- Observer* observer,
+ NetworkChangedObserver* observer,
RtcEventLog* event_log,
PacedSender* pacer)
: SendSideCongestionController(clock,
@@ -347,14 +344,15 @@
transport_feedback_adapter_.DeRegisterPacketFeedbackObserver(observer);
}
-void SendSideCongestionController::RegisterNetworkObserver(Observer* observer) {
+void SendSideCongestionController::RegisterNetworkObserver(
+ NetworkChangedObserver* observer) {
WaitOnTask([this, observer]() {
control_handler->RegisterNetworkObserver(observer);
});
}
void SendSideCongestionController::DeRegisterNetworkObserver(
- Observer* observer) {
+ NetworkChangedObserver* observer) {
WaitOnTask([this, observer]() {
control_handler->DeRegisterNetworkObserver(observer);
});
diff --git a/modules/congestion_controller/rtp/send_side_congestion_controller_unittest.cc b/modules/congestion_controller/rtp/send_side_congestion_controller_unittest.cc
index ea8479f..4f75b48 100644
--- a/modules/congestion_controller/rtp/send_side_congestion_controller_unittest.cc
+++ b/modules/congestion_controller/rtp/send_side_congestion_controller_unittest.cc
@@ -10,8 +10,9 @@
#include "modules/congestion_controller/rtp/include/send_side_congestion_controller.h"
#include "logging/rtc_event_log/mock/mock_rtc_event_log.h"
+#include "modules/congestion_controller/include/mock/mock_congestion_observer.h"
+#include "modules/congestion_controller/include/network_changed_observer.h"
#include "modules/congestion_controller/rtp/congestion_controller_unittests_helper.h"
-#include "modules/congestion_controller/rtp/include/mock/mock_congestion_observer.h"
#include "modules/pacing/mock/mock_paced_sender.h"
#include "modules/pacing/packet_router.h"
#include "modules/remote_bitrate_estimator/include/bwe_defines.h"
@@ -36,6 +37,7 @@
namespace test {
namespace {
+using webrtc::test::MockCongestionObserver;
const webrtc::PacedPacketInfo kPacingInfo0(0, 5, 2000);
const webrtc::PacedPacketInfo kPacingInfo1(1, 8, 4000);
@@ -46,7 +48,7 @@
: public SendSideCongestionController {
public:
SendSideCongestionControllerForTest(const Clock* clock,
- Observer* observer,
+ NetworkChangedObserver* observer,
RtcEventLog* event_log,
PacedSender* pacer)
: SendSideCongestionController(clock, observer, event_log, pacer) {}
@@ -58,7 +60,6 @@
};
} // namespace
-
class SendSideCongestionControllerTest : public ::testing::Test {
protected:
SendSideCongestionControllerTest()
@@ -102,7 +103,7 @@
// Allows us to track the target bitrate, without prescribing the exact
// iterations when this would hapen, like a mock would.
- class TargetBitrateObserver : public SendSideCongestionController::Observer {
+ class TargetBitrateObserver : public NetworkChangedObserver {
public:
explicit TargetBitrateObserver(SendSideCongestionControllerTest* owner)
: owner_(owner) {}
@@ -478,7 +479,7 @@
}
TEST_F(SendSideCongestionControllerTest, PacerQueueEncodeRatePushback) {
- ScopedFieldTrials pushback_field_trial(
+ ::webrtc::test::ScopedFieldTrials pushback_field_trial(
"WebRTC-PacerPushbackExperiment/Enabled/");
SetUp();
diff --git a/modules/congestion_controller/rtp/transport_feedback_adapter_unittest.cc b/modules/congestion_controller/rtp/transport_feedback_adapter_unittest.cc
index e62fc95..7008767 100644
--- a/modules/congestion_controller/rtp/transport_feedback_adapter_unittest.cc
+++ b/modules/congestion_controller/rtp/transport_feedback_adapter_unittest.cc
@@ -35,7 +35,7 @@
const PacedPacketInfo kPacingInfo2(2, 14, 7000);
const PacedPacketInfo kPacingInfo3(3, 20, 10000);
const PacedPacketInfo kPacingInfo4(4, 22, 10000);
-}
+} // namespace
namespace test {
@@ -86,8 +86,7 @@
const std::vector<PacketFeedback> packets = {
PacketFeedback(100, 200, 0, 1000, kPacingInfo0),
PacketFeedback(110, 210, 1, 2000, kPacingInfo0),
- PacketFeedback(120, 220, 2, 3000, kPacingInfo0)
- };
+ PacketFeedback(120, 220, 2, 3000, kPacingInfo0)};
rtcp::TransportFeedback feedback;
feedback.SetBase(packets[0].sequence_number,
@@ -169,8 +168,7 @@
PacketFeedback(130, 230, 3, 1500, kPacingInfo0),
PacketFeedback(140, 240, 4, 1500, kPacingInfo0),
PacketFeedback(150, 250, 5, 1500, kPacingInfo0),
- PacketFeedback(160, 260, 6, 1500, kPacingInfo0)
- };
+ PacketFeedback(160, 260, 6, 1500, kPacingInfo0)};
for (const PacketFeedback& packet : sent_packets)
OnSentPacket(packet);
@@ -178,8 +176,7 @@
// Note: Important to include the last packet, as only unreceived packets in
// between received packets can be inferred.
std::vector<PacketFeedback> received_packets = {
- sent_packets[0], sent_packets[2], sent_packets[6]
- };
+ sent_packets[0], sent_packets[2], sent_packets[6]};
rtcp::TransportFeedback feedback;
feedback.SetBase(received_packets[0].sequence_number,
diff --git a/modules/congestion_controller/send_side_congestion_controller_unittest.cc b/modules/congestion_controller/send_side_congestion_controller_unittest.cc
index cc67207..eacceb5 100644
--- a/modules/congestion_controller/send_side_congestion_controller_unittest.cc
+++ b/modules/congestion_controller/send_side_congestion_controller_unittest.cc
@@ -44,11 +44,11 @@
namespace test {
-class SendSideCongestionControllerTest : public ::testing::Test {
+class LegacySendSideCongestionControllerTest : public ::testing::Test {
protected:
- SendSideCongestionControllerTest()
+ LegacySendSideCongestionControllerTest()
: clock_(123456), target_bitrate_observer_(this) {}
- ~SendSideCongestionControllerTest() override {}
+ ~LegacySendSideCongestionControllerTest() override {}
void SetUp() override {
pacer_.reset(new NiceMock<MockPacedSender>());
@@ -87,7 +87,8 @@
// iterations when this would hapen, like a mock would.
class TargetBitrateObserver : public NetworkChangedObserver {
public:
- explicit TargetBitrateObserver(SendSideCongestionControllerTest* owner)
+ explicit TargetBitrateObserver(
+ LegacySendSideCongestionControllerTest* owner)
: owner_(owner) {}
~TargetBitrateObserver() override = default;
void OnNetworkChanged(uint32_t bitrate_bps,
@@ -98,7 +99,7 @@
}
private:
- SendSideCongestionControllerTest* owner_;
+ LegacySendSideCongestionControllerTest* owner_;
};
void PacketTransmissionAndFeedbackBlock(uint16_t* seq_num,
@@ -142,7 +143,7 @@
rtc::Optional<uint32_t> target_bitrate_bps_;
};
-TEST_F(SendSideCongestionControllerTest, OnNetworkChanged) {
+TEST_F(LegacySendSideCongestionControllerTest, OnNetworkChanged) {
// Test no change.
clock_.AdvanceTimeMilliseconds(25);
controller_->Process();
@@ -160,7 +161,7 @@
controller_->Process();
}
-TEST_F(SendSideCongestionControllerTest, OnSendQueueFull) {
+TEST_F(LegacySendSideCongestionControllerTest, OnSendQueueFull) {
EXPECT_CALL(*pacer_, ExpectedQueueTimeMs())
.WillOnce(Return(PacedSender::kMaxQueueLengthMs + 1));
@@ -175,7 +176,8 @@
controller_->Process();
}
-TEST_F(SendSideCongestionControllerTest, OnSendQueueFullAndEstimateChange) {
+TEST_F(LegacySendSideCongestionControllerTest,
+ OnSendQueueFullAndEstimateChange) {
EXPECT_CALL(*pacer_, ExpectedQueueTimeMs())
.WillOnce(Return(PacedSender::kMaxQueueLengthMs + 1));
EXPECT_CALL(observer_, OnNetworkChanged(0, _, _, _));
@@ -199,7 +201,7 @@
controller_->Process();
}
-TEST_F(SendSideCongestionControllerTest, SignalNetworkState) {
+TEST_F(LegacySendSideCongestionControllerTest, SignalNetworkState) {
EXPECT_CALL(observer_, OnNetworkChanged(0, _, _, _));
controller_->SignalNetworkState(kNetworkDown);
@@ -210,7 +212,7 @@
controller_->SignalNetworkState(kNetworkDown);
}
-TEST_F(SendSideCongestionControllerTest, OnNetworkRouteChanged) {
+TEST_F(LegacySendSideCongestionControllerTest, OnNetworkRouteChanged) {
int new_bitrate = 200000;
testing::Mock::VerifyAndClearExpectations(pacer_.get());
EXPECT_CALL(observer_, OnNetworkChanged(new_bitrate, _, _, _));
@@ -230,7 +232,7 @@
controller_->OnNetworkRouteChanged(route, -1, -1, -1);
}
-TEST_F(SendSideCongestionControllerTest, OldFeedback) {
+TEST_F(LegacySendSideCongestionControllerTest, OldFeedback) {
int new_bitrate = 200000;
testing::Mock::VerifyAndClearExpectations(pacer_.get());
EXPECT_CALL(observer_, OnNetworkChanged(new_bitrate, _, _, _));
@@ -273,7 +275,7 @@
controller_->OnNetworkRouteChanged(route, -1, -1, -1);
}
-TEST_F(SendSideCongestionControllerTest,
+TEST_F(LegacySendSideCongestionControllerTest,
SignalNetworkStateAndQueueIsFullAndEstimateChange) {
// Send queue is full
EXPECT_CALL(*pacer_, ExpectedQueueTimeMs())
@@ -302,7 +304,7 @@
controller_->Process();
}
-TEST_F(SendSideCongestionControllerTest, GetPacerQueuingDelayMs) {
+TEST_F(LegacySendSideCongestionControllerTest, GetPacerQueuingDelayMs) {
EXPECT_CALL(observer_, OnNetworkChanged(_, _, _, _)).Times(AtLeast(1));
const int64_t kQueueTimeMs = 123;
@@ -318,7 +320,7 @@
EXPECT_EQ(kQueueTimeMs, controller_->GetPacerQueuingDelayMs());
}
-TEST_F(SendSideCongestionControllerTest, GetProbingInterval) {
+TEST_F(LegacySendSideCongestionControllerTest, GetProbingInterval) {
clock_.AdvanceTimeMilliseconds(25);
controller_->Process();
@@ -329,7 +331,7 @@
controller_->Process();
}
-TEST_F(SendSideCongestionControllerTest, ProbeOnRouteChange) {
+TEST_F(LegacySendSideCongestionControllerTest, ProbeOnRouteChange) {
testing::Mock::VerifyAndClearExpectations(pacer_.get());
EXPECT_CALL(*pacer_, CreateProbeCluster(kInitialBitrateBps * 6));
EXPECT_CALL(*pacer_, CreateProbeCluster(kInitialBitrateBps * 12));
@@ -342,7 +344,7 @@
// Estimated bitrate reduced when the feedbacks arrive with such a long delay,
// that the send-time-history no longer holds the feedbacked packets.
-TEST_F(SendSideCongestionControllerTest, LongFeedbackDelays) {
+TEST_F(LegacySendSideCongestionControllerTest, LongFeedbackDelays) {
TargetBitrateTrackingSetup();
const int64_t kFeedbackTimeoutMs = 60001;
@@ -433,7 +435,7 @@
// Bandwidth estimation is updated when feedbacks are received.
// Feedbacks which show an increasing delay cause the estimation to be reduced.
-TEST_F(SendSideCongestionControllerTest, UpdatesDelayBasedEstimate) {
+TEST_F(LegacySendSideCongestionControllerTest, UpdatesDelayBasedEstimate) {
TargetBitrateTrackingSetup();
const int64_t kRunTimeMs = 6000;
@@ -452,7 +454,7 @@
EXPECT_LT(*target_bitrate_bps_, bitrate_before_delay);
}
-TEST_F(SendSideCongestionControllerTest, PacerQueueEncodeRatePushback) {
+TEST_F(LegacySendSideCongestionControllerTest, PacerQueueEncodeRatePushback) {
ScopedFieldTrials pushback_field_trial(
"WebRTC-PacerPushbackExperiment/Enabled/");
SetUp();
diff --git a/modules/congestion_controller/send_time_history_unittest.cc b/modules/congestion_controller/send_time_history_unittest.cc
index 64f30c0..1356b5c 100644
--- a/modules/congestion_controller/send_time_history_unittest.cc
+++ b/modules/congestion_controller/send_time_history_unittest.cc
@@ -23,11 +23,11 @@
static const int kDefaultHistoryLengthMs = 1000;
-class SendTimeHistoryTest : public ::testing::Test {
+class LegacySendTimeHistoryTest : public ::testing::Test {
protected:
- SendTimeHistoryTest()
+ LegacySendTimeHistoryTest()
: clock_(0), history_(&clock_, kDefaultHistoryLengthMs) {}
- ~SendTimeHistoryTest() {}
+ ~LegacySendTimeHistoryTest() {}
virtual void SetUp() {}
@@ -47,7 +47,7 @@
SendTimeHistory history_;
};
-TEST_F(SendTimeHistoryTest, SaveAndRestoreNetworkId) {
+TEST_F(LegacySendTimeHistoryTest, SaveAndRestoreNetworkId) {
const PacedPacketInfo kPacingInfo(0, 5, 1200);
uint16_t sequence_number = 0;
int64_t now_ms = clock_.TimeInMilliseconds();
@@ -63,7 +63,7 @@
}
}
-TEST_F(SendTimeHistoryTest, AddRemoveOne) {
+TEST_F(LegacySendTimeHistoryTest, AddRemoveOne) {
const uint16_t kSeqNo = 10;
// TODO(philipel): Fix PacedPacketInfo constructor?
const PacedPacketInfo kPacingInfo(0, 5, 1200);
@@ -82,7 +82,7 @@
EXPECT_FALSE(history_.GetFeedback(&received_packet3, true));
}
-TEST_F(SendTimeHistoryTest, PopulatesExpectedFields) {
+TEST_F(LegacySendTimeHistoryTest, PopulatesExpectedFields) {
const uint16_t kSeqNo = 10;
const int64_t kSendTime = 1000;
const int64_t kReceiveTime = 2000;
@@ -100,7 +100,7 @@
EXPECT_EQ(kPacingInfo, packet_feedback.pacing_info);
}
-TEST_F(SendTimeHistoryTest, AddThenRemoveOutOfOrder) {
+TEST_F(LegacySendTimeHistoryTest, AddThenRemoveOutOfOrder) {
std::vector<PacketFeedback> sent_packets;
std::vector<PacketFeedback> received_packets;
const size_t num_items = 100;
@@ -138,7 +138,7 @@
EXPECT_FALSE(history_.GetFeedback(&packet, false));
}
-TEST_F(SendTimeHistoryTest, HistorySize) {
+TEST_F(LegacySendTimeHistoryTest, HistorySize) {
const int kItems = kDefaultHistoryLengthMs / 100;
for (int i = 0; i < kItems; ++i) {
clock_.AdvanceTimeMilliseconds(100);
@@ -162,7 +162,7 @@
}
}
-TEST_F(SendTimeHistoryTest, HistorySizeWithWraparound) {
+TEST_F(LegacySendTimeHistoryTest, HistorySizeWithWraparound) {
const uint16_t kMaxSeqNo = std::numeric_limits<uint16_t>::max();
AddPacketWithSendTime(kMaxSeqNo - 2, 0, 0, PacedPacketInfo());
@@ -203,7 +203,7 @@
EXPECT_TRUE(history_.GetFeedback(&packet10, false));
}
-TEST_F(SendTimeHistoryTest, InterlievedGetAndRemove) {
+TEST_F(LegacySendTimeHistoryTest, InterlievedGetAndRemove) {
const uint16_t kSeqNo = 1;
const int64_t kTimestamp = 2;
const PacedPacketInfo kPacingInfo1(1, 1, 100);
diff --git a/modules/congestion_controller/transport_feedback_adapter_unittest.cc b/modules/congestion_controller/transport_feedback_adapter_unittest.cc
index 1cff0d9..87383f0 100644
--- a/modules/congestion_controller/transport_feedback_adapter_unittest.cc
+++ b/modules/congestion_controller/transport_feedback_adapter_unittest.cc
@@ -45,11 +45,11 @@
void(const std::vector<PacketFeedback>& packet_feedback_vector));
};
-class TransportFeedbackAdapterTest : public ::testing::Test {
+class LegacyTransportFeedbackAdapterTest : public ::testing::Test {
public:
- TransportFeedbackAdapterTest() : clock_(0) {}
+ LegacyTransportFeedbackAdapterTest() : clock_(0) {}
- virtual ~TransportFeedbackAdapterTest() {}
+ virtual ~LegacyTransportFeedbackAdapterTest() {}
virtual void SetUp() {
adapter_.reset(new TransportFeedbackAdapter(&clock_));
@@ -78,7 +78,7 @@
std::unique_ptr<TransportFeedbackAdapter> adapter_;
};
-TEST_F(TransportFeedbackAdapterTest, ObserverSanity) {
+TEST_F(LegacyTransportFeedbackAdapterTest, ObserverSanity) {
MockPacketFeedbackObserver mock;
adapter_->RegisterPacketFeedbackObserver(&mock);
@@ -119,14 +119,16 @@
}
#if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID)
-TEST_F(TransportFeedbackAdapterTest, ObserverDoubleRegistrationDeathTest) {
+TEST_F(LegacyTransportFeedbackAdapterTest,
+ ObserverDoubleRegistrationDeathTest) {
MockPacketFeedbackObserver mock;
adapter_->RegisterPacketFeedbackObserver(&mock);
EXPECT_DEATH(adapter_->RegisterPacketFeedbackObserver(&mock), "");
adapter_->DeRegisterPacketFeedbackObserver(&mock);
}
-TEST_F(TransportFeedbackAdapterTest, ObserverMissingDeRegistrationDeathTest) {
+TEST_F(LegacyTransportFeedbackAdapterTest,
+ ObserverMissingDeRegistrationDeathTest) {
MockPacketFeedbackObserver mock;
adapter_->RegisterPacketFeedbackObserver(&mock);
EXPECT_DEATH(adapter_.reset(), "");
@@ -134,7 +136,8 @@
}
#endif
-TEST_F(TransportFeedbackAdapterTest, AdaptsFeedbackAndPopulatesSendTimes) {
+TEST_F(LegacyTransportFeedbackAdapterTest,
+ AdaptsFeedbackAndPopulatesSendTimes) {
std::vector<PacketFeedback> packets;
packets.push_back(PacketFeedback(100, 200, 0, 1500, kPacingInfo0));
packets.push_back(PacketFeedback(110, 210, 1, 1500, kPacingInfo0));
@@ -160,7 +163,7 @@
ComparePacketFeedbackVectors(packets, adapter_->GetTransportFeedbackVector());
}
-TEST_F(TransportFeedbackAdapterTest, FeedbackVectorReportsUnreceived) {
+TEST_F(LegacyTransportFeedbackAdapterTest, FeedbackVectorReportsUnreceived) {
std::vector<PacketFeedback> sent_packets = {
PacketFeedback(100, 220, 0, 1500, kPacingInfo0),
PacketFeedback(110, 210, 1, 1500, kPacingInfo0),
@@ -196,7 +199,7 @@
adapter_->GetTransportFeedbackVector());
}
-TEST_F(TransportFeedbackAdapterTest, HandlesDroppedPackets) {
+TEST_F(LegacyTransportFeedbackAdapterTest, HandlesDroppedPackets) {
std::vector<PacketFeedback> packets;
packets.push_back(PacketFeedback(100, 200, 0, 1500, kPacingInfo0));
packets.push_back(PacketFeedback(110, 210, 1, 1500, kPacingInfo1));
@@ -240,7 +243,7 @@
adapter_->GetTransportFeedbackVector());
}
-TEST_F(TransportFeedbackAdapterTest, SendTimeWrapsBothWays) {
+TEST_F(LegacyTransportFeedbackAdapterTest, SendTimeWrapsBothWays) {
int64_t kHighArrivalTimeMs = rtcp::TransportFeedback::kDeltaScaleFactor *
static_cast<int64_t>(1 << 8) *
static_cast<int64_t>((1 << 23) - 1) / 1000;
@@ -277,7 +280,7 @@
}
}
-TEST_F(TransportFeedbackAdapterTest, HandlesArrivalReordering) {
+TEST_F(LegacyTransportFeedbackAdapterTest, HandlesArrivalReordering) {
std::vector<PacketFeedback> packets;
packets.push_back(PacketFeedback(120, 200, 0, 1500, kPacingInfo0));
packets.push_back(PacketFeedback(110, 210, 1, 1500, kPacingInfo0));
@@ -304,7 +307,7 @@
ComparePacketFeedbackVectors(packets, adapter_->GetTransportFeedbackVector());
}
-TEST_F(TransportFeedbackAdapterTest, TimestampDeltas) {
+TEST_F(LegacyTransportFeedbackAdapterTest, TimestampDeltas) {
std::vector<PacketFeedback> sent_packets;
const int64_t kSmallDeltaUs =
rtcp::TransportFeedback::kDeltaScaleFactor * ((1 << 8) - 1);
diff --git a/modules/congestion_controller/trendline_estimator_unittest.cc b/modules/congestion_controller/trendline_estimator_unittest.cc
index e44f503..c11d1c3 100644
--- a/modules/congestion_controller/trendline_estimator_unittest.cc
+++ b/modules/congestion_controller/trendline_estimator_unittest.cc
@@ -46,27 +46,27 @@
}
} // namespace
-TEST(TrendlineEstimator, PerfectLineSlopeOneHalf) {
+TEST(LegacyTrendlineEstimator, PerfectLineSlopeOneHalf) {
TestEstimator(0.5, 0, 0.001);
}
-TEST(TrendlineEstimator, PerfectLineSlopeMinusOne) {
+TEST(LegacyTrendlineEstimator, PerfectLineSlopeMinusOne) {
TestEstimator(-1, 0, 0.001);
}
-TEST(TrendlineEstimator, PerfectLineSlopeZero) {
+TEST(LegacyTrendlineEstimator, PerfectLineSlopeZero) {
TestEstimator(0, 0, 0.001);
}
-TEST(TrendlineEstimator, JitteryLineSlopeOneHalf) {
+TEST(LegacyTrendlineEstimator, JitteryLineSlopeOneHalf) {
TestEstimator(0.5, kAvgTimeBetweenPackets / 3.0, 0.01);
}
-TEST(TrendlineEstimator, JitteryLineSlopeMinusOne) {
+TEST(LegacyTrendlineEstimator, JitteryLineSlopeMinusOne) {
TestEstimator(-1, kAvgTimeBetweenPackets / 3.0, 0.075);
}
-TEST(TrendlineEstimator, JitteryLineSlopeZero) {
+TEST(LegacyTrendlineEstimator, JitteryLineSlopeZero) {
TestEstimator(0, kAvgTimeBetweenPackets / 3.0, 0.02);
}
diff --git a/modules/pacing/alr_detector_unittest.cc b/modules/pacing/alr_detector_unittest.cc
index 356e14e..f892fbd 100644
--- a/modules/pacing/alr_detector_unittest.cc
+++ b/modules/pacing/alr_detector_unittest.cc
@@ -65,7 +65,7 @@
};
} // namespace
-class AlrDetectorTest : public testing::Test {
+class LegacyAlrDetectorTest : public testing::Test {
public:
void SetUp() override {
alr_detector_.SetEstimatedBitrate(kEstimatedBitrateBps);
@@ -75,7 +75,7 @@
AlrDetector alr_detector_;
};
-TEST_F(AlrDetectorTest, AlrDetection) {
+TEST_F(LegacyAlrDetectorTest, AlrDetection) {
// Start in non-ALR state.
EXPECT_FALSE(alr_detector_.GetApplicationLimitedRegionStartTime());
@@ -98,7 +98,7 @@
EXPECT_FALSE(alr_detector_.GetApplicationLimitedRegionStartTime());
}
-TEST_F(AlrDetectorTest, ShortSpike) {
+TEST_F(LegacyAlrDetectorTest, ShortSpike) {
// Start in non-ALR state.
EXPECT_FALSE(alr_detector_.GetApplicationLimitedRegionStartTime());
@@ -121,7 +121,7 @@
EXPECT_FALSE(alr_detector_.GetApplicationLimitedRegionStartTime());
}
-TEST_F(AlrDetectorTest, BandwidthEstimateChanges) {
+TEST_F(LegacyAlrDetectorTest, BandwidthEstimateChanges) {
// Start in non-ALR state.
EXPECT_FALSE(alr_detector_.GetApplicationLimitedRegionStartTime());
@@ -143,7 +143,7 @@
EXPECT_FALSE(alr_detector_.GetApplicationLimitedRegionStartTime());
}
-TEST_F(AlrDetectorTest, ParseControlFieldTrial) {
+TEST_F(LegacyAlrDetectorTest, ParseControlFieldTrial) {
webrtc::test::ScopedFieldTrials field_trial(
"WebRTC-ProbingScreenshareBwe/Control/");
rtc::Optional<AlrExperimentSettings> parsed_params =
@@ -152,7 +152,7 @@
EXPECT_FALSE(static_cast<bool>(parsed_params));
}
-TEST_F(AlrDetectorTest, ParseActiveFieldTrial) {
+TEST_F(LegacyAlrDetectorTest, ParseActiveFieldTrial) {
webrtc::test::ScopedFieldTrials field_trial(
"WebRTC-ProbingScreenshareBwe/1.1,2875,85,20,-20,1/");
rtc::Optional<AlrExperimentSettings> parsed_params =