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

Side by Side Diff: webrtc/audio/audio_send_stream_unittest.cc

Issue 2518923003: Pass time constant to bwe smoothing filter. (Closed)
Patch Set: Removed Optional in SetBitrate Created 4 years 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 stream_config_.rtp.ssrc = kSsrc; 91 stream_config_.rtp.ssrc = kSsrc;
92 stream_config_.rtp.nack.rtp_history_ms = 200; 92 stream_config_.rtp.nack.rtp_history_ms = 200;
93 stream_config_.rtp.c_name = kCName; 93 stream_config_.rtp.c_name = kCName;
94 stream_config_.rtp.extensions.push_back( 94 stream_config_.rtp.extensions.push_back(
95 RtpExtension(RtpExtension::kAudioLevelUri, kAudioLevelId)); 95 RtpExtension(RtpExtension::kAudioLevelUri, kAudioLevelId));
96 stream_config_.rtp.extensions.push_back(RtpExtension( 96 stream_config_.rtp.extensions.push_back(RtpExtension(
97 RtpExtension::kTransportSequenceNumberUri, kTransportSequenceNumberId)); 97 RtpExtension::kTransportSequenceNumberUri, kTransportSequenceNumberId));
98 // Use ISAC as default codec so as to prevent unnecessary |voice_engine_| 98 // Use ISAC as default codec so as to prevent unnecessary |voice_engine_|
99 // calls from the default ctor behavior. 99 // calls from the default ctor behavior.
100 stream_config_.send_codec_spec.codec_inst = kIsacCodec; 100 stream_config_.send_codec_spec.codec_inst = kIsacCodec;
101 stream_config_.min_bitrate_bps = 10000;
102 stream_config_.max_bitrate_bps = 65000;
101 } 103 }
102 104
103 AudioSendStream::Config& config() { return stream_config_; } 105 AudioSendStream::Config& config() { return stream_config_; }
104 rtc::scoped_refptr<AudioState> audio_state() { return audio_state_; } 106 rtc::scoped_refptr<AudioState> audio_state() { return audio_state_; }
105 MockVoEChannelProxy* channel_proxy() { return channel_proxy_; } 107 MockVoEChannelProxy* channel_proxy() { return channel_proxy_; }
106 CongestionController* congestion_controller() { 108 CongestionController* congestion_controller() {
107 return &congestion_controller_; 109 return &congestion_controller_;
108 } 110 }
109 BitrateAllocator* bitrate_allocator() { return &bitrate_allocator_; } 111 BitrateAllocator* bitrate_allocator() { return &bitrate_allocator_; }
110 rtc::TaskQueue* worker_queue() { return &worker_queue_; } 112 rtc::TaskQueue* worker_queue() { return &worker_queue_; }
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 stream_config.send_codec_spec.cng_plfreq = 8000; 386 stream_config.send_codec_spec.cng_plfreq = 8000;
385 stream_config.send_codec_spec.cng_payload_type = 105; 387 stream_config.send_codec_spec.cng_payload_type = 105;
386 EXPECT_CALL(*helper.voice_engine(), SetVADStatus(kChannelId, true, _, _)) 388 EXPECT_CALL(*helper.voice_engine(), SetVADStatus(kChannelId, true, _, _))
387 .WillOnce(Return(0)); 389 .WillOnce(Return(0));
388 internal::AudioSendStream send_stream( 390 internal::AudioSendStream send_stream(
389 stream_config, helper.audio_state(), helper.worker_queue(), 391 stream_config, helper.audio_state(), helper.worker_queue(),
390 helper.congestion_controller(), helper.bitrate_allocator(), 392 helper.congestion_controller(), helper.bitrate_allocator(),
391 helper.event_log()); 393 helper.event_log());
392 } 394 }
393 395
396 TEST(AudioSendStreamTest, DoesNotPassHigherBitrateThanMaxBitrate) {
397 ConfigHelper helper;
398 internal::AudioSendStream send_stream(
399 helper.config(), helper.audio_state(), helper.worker_queue(),
400 helper.congestion_controller(), helper.bitrate_allocator(),
401 helper.event_log());
402 EXPECT_CALL(*helper.channel_proxy(),
403 SetBitrate(helper.config().max_bitrate_bps, _));
404 send_stream.OnBitrateUpdated(helper.config().max_bitrate_bps + 5000, 0.0, 50,
405 6000);
406 }
407
408 TEST(AudioSendStreamTest, ProbingIntervalOnBitrateUpdated) {
409 ConfigHelper helper;
410 internal::AudioSendStream send_stream(
411 helper.config(), helper.audio_state(), helper.worker_queue(),
412 helper.congestion_controller(), helper.bitrate_allocator(),
413 helper.event_log());
414 EXPECT_CALL(*helper.channel_proxy(), SetBitrate(_, 5000));
415 send_stream.OnBitrateUpdated(50000, 0.0, 50, 5000);
416
417 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.
418 send_stream.OnBitrateUpdated(50000, 0.0, 50, 6000);
419 }
420
394 } // namespace test 421 } // namespace test
395 } // namespace webrtc 422 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698