diff --git a/call/rtp_video_sender_unittest.cc b/call/rtp_video_sender_unittest.cc index bd8a6a67c6..29fc2b6020 100644 --- a/call/rtp_video_sender_unittest.cc +++ b/call/rtp_video_sender_unittest.cc @@ -137,7 +137,23 @@ class RtpVideoSenderTestFixture { }; } // namespace -TEST(RtpVideoSenderTest, SendOnOneModule) { +class RtpVideoSenderTest : public ::testing::Test, + public ::testing::WithParamInterface { + public: + RtpVideoSenderTest() : field_trial_(GetParam()) {} + + private: + test::ScopedFieldTrials field_trial_; +}; + +INSTANTIATE_TEST_CASE_P(Default, RtpVideoSenderTest, ::testing::Values("")); + +INSTANTIATE_TEST_CASE_P( + TaskQueueTrial, + RtpVideoSenderTest, + ::testing::Values("WebRTC-TaskQueueCongestionControl/Enabled/")); + +TEST_P(RtpVideoSenderTest, SendOnOneModule) { uint8_t payload = 'a'; EncodedImage encoded_image; encoded_image.SetTimestamp(1); @@ -167,7 +183,7 @@ TEST(RtpVideoSenderTest, SendOnOneModule) { test.router()->OnEncodedImage(encoded_image, nullptr, nullptr).error); } -TEST(RtpVideoSenderTest, SendSimulcastSetActive) { +TEST_P(RtpVideoSenderTest, SendSimulcastSetActive) { uint8_t payload = 'a'; EncodedImage encoded_image_1; encoded_image_1.SetTimestamp(1); @@ -211,7 +227,7 @@ TEST(RtpVideoSenderTest, SendSimulcastSetActive) { // behavior of the payload router. First sets one module to active and checks // that outgoing data can be sent on this module, and checks that no data can // be sent if both modules are inactive. -TEST(RtpVideoSenderTest, SendSimulcastSetActiveModules) { +TEST_P(RtpVideoSenderTest, SendSimulcastSetActiveModules) { uint8_t payload = 'a'; EncodedImage encoded_image_1; encoded_image_1.SetTimestamp(1); @@ -252,7 +268,7 @@ TEST(RtpVideoSenderTest, SendSimulcastSetActiveModules) { .error); } -TEST(RtpVideoSenderTest, CreateWithNoPreviousStates) { +TEST_P(RtpVideoSenderTest, CreateWithNoPreviousStates) { RtpVideoSenderTestFixture test({kSsrc1, kSsrc2}, kPayloadType, {}); test.router()->SetActive(true); @@ -263,7 +279,7 @@ TEST(RtpVideoSenderTest, CreateWithNoPreviousStates) { EXPECT_NE(initial_states.find(kSsrc2), initial_states.end()); } -TEST(RtpVideoSenderTest, CreateWithPreviousStates) { +TEST_P(RtpVideoSenderTest, CreateWithPreviousStates) { const int64_t kState1SharedFrameId = 123; const int64_t kState2SharedFrameId = 234; RtpPayloadState state1; diff --git a/modules/congestion_controller/rtp/send_side_congestion_controller.cc b/modules/congestion_controller/rtp/send_side_congestion_controller.cc index e0d8f145cb..70a8d496bb 100644 --- a/modules/congestion_controller/rtp/send_side_congestion_controller.cc +++ b/modules/congestion_controller/rtp/send_side_congestion_controller.cc @@ -368,6 +368,15 @@ SendSideCongestionController::SendSideCongestionController( initial_config_.constraints = ConvertConstraints( min_bitrate_bps, max_bitrate_bps, start_bitrate_bps, clock_); RTC_DCHECK(start_bitrate_bps > 0); + // To be fully compatible with legacy SendSideCongestionController, make sure + // pacer is initialized even if there are no registered streams. This should + // not happen under normal circumstances, but some tests rely on it and there + // are no checks detecting when the legacy SendSideCongestionController is + // used. This way of setting the value has the drawback that it might be wrong + // compared to what the actual value from the congestion controller will be. + // TODO(srte): Remove this when the legacy SendSideCongestionController is + // removed. + pacer_->SetEstimatedBitrate(start_bitrate_bps); } // There is no point in having a network controller for a network that is not