Chromium Code Reviews| 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..e71304056b79c590fe7fa788850cc40d7e4586c6 100644 |
| --- a/webrtc/audio/audio_send_stream_unittest.cc |
| +++ b/webrtc/audio/audio_send_stream_unittest.cc |
| @@ -98,6 +98,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 +393,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)); |
|
minyue-webrtc
2016/11/28 12:00:00
what is additional value of testing the second cal
michaelt
2016/11/28 13:03:37
It shows that the value which is set in SetBitrate
minyue-webrtc
2016/11/28 13:14:42
Yes. but I don't think it is that valuable. There
michaelt
2016/11/28 13:30:09
Ok will remove the second test.
|
| + send_stream.OnBitrateUpdated(50000, 0.0, 50, 6000); |
| +} |
| + |
| } // namespace test |
| } // namespace webrtc |