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

Unified Diff: webrtc/audio/audio_send_stream_unittest.cc

Issue 2966503002: Always ResetSenderCongestionControlObjects before RegisterEtc... (Closed)
Patch Set: Added a test to ensure Reset is called first. Created 3 years, 6 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/audio/audio_send_stream.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/audio/audio_send_stream_unittest.cc
diff --git a/webrtc/audio/audio_send_stream_unittest.cc b/webrtc/audio/audio_send_stream_unittest.cc
index e6acf92efb61702031d04086ecaf25639b47069b..31483697ffca98d593c7c8441a5f2394efd7a60b 100644
--- a/webrtc/audio/audio_send_stream_unittest.cc
+++ b/webrtc/audio/audio_send_stream_unittest.cc
@@ -173,10 +173,7 @@ struct ConfigHelper {
stream_config_.rtp.extensions.push_back(
RtpExtension(RtpExtension::kAudioLevelUri, kAudioLevelId));
if (audio_bwe_enabled) {
- stream_config_.rtp.extensions.push_back(
- RtpExtension(RtpExtension::kTransportSequenceNumberUri,
- kTransportSequenceNumberId));
- stream_config_.send_codec_spec->transport_cc_enabled = true;
+ AddBweToConfig(&stream_config_);
}
stream_config_.encoder_factory = SetupEncoderFactoryMock();
stream_config_.min_bitrate_bps = 10000;
@@ -196,6 +193,13 @@ struct ConfigHelper {
RtcEventLog* event_log() { return &event_log_; }
MockVoiceEngine* voice_engine() { return &voice_engine_; }
+ static void AddBweToConfig(AudioSendStream::Config* config) {
+ config->rtp.extensions.push_back(
+ RtpExtension(RtpExtension::kTransportSequenceNumberUri,
+ kTransportSequenceNumberId));
+ config->send_codec_spec->transport_cc_enabled = true;
+ }
+
void SetupDefaultChannelProxy(bool audio_bwe_enabled) {
using testing::StrEq;
channel_proxy_ = new testing::StrictMock<MockVoEChannelProxy>();
@@ -542,5 +546,28 @@ TEST(AudioSendStreamTest, DontRecreateEncoder) {
send_stream.Reconfigure(stream_config);
}
+TEST(AudioSendStreamTest, ReconfigureTransportCcResetsFirst) {
+ ConfigHelper helper(false, true);
+ internal::AudioSendStream send_stream(
+ helper.config(), helper.audio_state(), helper.worker_queue(),
+ helper.transport(), helper.bitrate_allocator(), helper.event_log(),
+ helper.rtcp_rtt_stats(), rtc::Optional<RtpState>());
+ auto new_config = helper.config();
+ ConfigHelper::AddBweToConfig(&new_config);
+ EXPECT_CALL(*helper.channel_proxy(),
+ EnableSendTransportSequenceNumber(kTransportSequenceNumberId))
+ .Times(1);
+ {
+ ::testing::InSequence seq;
+ EXPECT_CALL(*helper.channel_proxy(), ResetSenderCongestionControlObjects())
+ .Times(1);
+ EXPECT_CALL(*helper.channel_proxy(), RegisterSenderCongestionControlObjects(
+ helper.transport(), Ne(nullptr)))
+ .Times(1);
+ }
+ send_stream.Reconfigure(new_config);
+}
+
+
} // namespace test
} // namespace webrtc
« no previous file with comments | « webrtc/audio/audio_send_stream.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698