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

Unified Diff: webrtc/audio/audio_send_stream_unittest.cc

Issue 2518923003: Pass time constant to bwe smoothing filter. (Closed)
Patch Set: Respond to comments. Created 4 years, 1 month 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
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 2cb12750211842bda5111e67dcba460fb6570800..2525bad40200ef176460335473e964a7e9363b4c 100644
--- a/webrtc/audio/audio_send_stream_unittest.cc
+++ b/webrtc/audio/audio_send_stream_unittest.cc
@@ -91,6 +91,7 @@ struct ConfigHelper {
stream_config_.rtp.ssrc = kSsrc;
stream_config_.rtp.nack.rtp_history_ms = 200;
stream_config_.rtp.c_name = kCName;
+ stream_config_.rtp.ssrc = kSsrc;
the sun 2016/11/23 09:12:34 This is dupe from 3 lines above.
michaelt 2016/11/23 12:28:29 Removed the duplicated line.
stream_config_.rtp.extensions.push_back(
RtpExtension(RtpExtension::kAudioLevelUri, kAudioLevelId));
stream_config_.rtp.extensions.push_back(RtpExtension(
@@ -98,6 +99,8 @@ struct ConfigHelper {
// Use ISAC as default codec so as to prevent unnecessary |voice_engine_|
// calls from the default ctor behavior.
stream_config_.send_codec_spec.codec_inst = kIsacCodec;
+ stream_config_.min_bitrate_bps = 10000;
+ stream_config_.max_bitrate_bps = 65000;
}
AudioSendStream::Config& config() { return stream_config_; }
@@ -391,5 +394,30 @@ TEST(AudioSendStreamTest, SendCodecCanApplyVad) {
helper.event_log());
}
+TEST(AudioSendStreamTest, DoesNotPassHigherBitrateThanMaxBitrate) {
+ ConfigHelper helper;
+ internal::AudioSendStream send_stream(
+ helper.config(), helper.audio_state(), helper.worker_queue(),
+ helper.congestion_controller(), helper.bitrate_allocator(),
+ helper.event_log());
+ EXPECT_CALL(*helper.channel_proxy(),
+ SetBitrate(helper.config().max_bitrate_bps, _));
+ send_stream.OnBitrateUpdated(helper.config().max_bitrate_bps + 5000, 0.0, 50,
+ 6000);
+}
+
+TEST(AudioSendStreamTest, ProbingIntervalOnBitrateUpdated) {
+ ConfigHelper helper;
+ internal::AudioSendStream send_stream(
+ helper.config(), helper.audio_state(), helper.worker_queue(),
+ helper.congestion_controller(), helper.bitrate_allocator(),
+ helper.event_log());
+ EXPECT_CALL(*helper.channel_proxy(), SetBitrate(_, 5000));
+ send_stream.OnBitrateUpdated(50000, 0.0, 50, 5000);
+
+ EXPECT_CALL(*helper.channel_proxy(), SetBitrate(_, 6000));
+ send_stream.OnBitrateUpdated(50000, 0.0, 50, 6000);
+}
+
} // namespace test
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698