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

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

Issue 2518923003: Pass time constant to bwe smoothing filter. (Closed)
Patch Set: 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 .WillOnce(Invoke([this](int channel_id) { 84 .WillOnce(Invoke([this](int channel_id) {
85 return channel_proxy_; 85 return channel_proxy_;
86 })); 86 }));
87 87
88 SetupMockForSetupSendCodec(); 88 SetupMockForSetupSendCodec();
89 89
90 stream_config_.voe_channel_id = kChannelId; 90 stream_config_.voe_channel_id = kChannelId;
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.ssrc = kSsrc;
94 stream_config_.rtp.extensions.push_back( 95 stream_config_.rtp.extensions.push_back(
95 RtpExtension(RtpExtension::kAudioLevelUri, kAudioLevelId)); 96 RtpExtension(RtpExtension::kAudioLevelUri, kAudioLevelId));
96 stream_config_.rtp.extensions.push_back(RtpExtension( 97 stream_config_.rtp.extensions.push_back(RtpExtension(
97 RtpExtension::kTransportSequenceNumberUri, kTransportSequenceNumberId)); 98 RtpExtension::kTransportSequenceNumberUri, kTransportSequenceNumberId));
98 // Use ISAC as default codec so as to prevent unnecessary |voice_engine_| 99 // Use ISAC as default codec so as to prevent unnecessary |voice_engine_|
99 // calls from the default ctor behavior. 100 // calls from the default ctor behavior.
100 stream_config_.send_codec_spec.codec_inst = kIsacCodec; 101 stream_config_.send_codec_spec.codec_inst = kIsacCodec;
102 stream_config_.min_bitrate_bps = 10000;
103 stream_config_.max_bitrate_bps = 65000;
101 } 104 }
102 105
103 AudioSendStream::Config& config() { return stream_config_; } 106 AudioSendStream::Config& config() { return stream_config_; }
104 rtc::scoped_refptr<AudioState> audio_state() { return audio_state_; } 107 rtc::scoped_refptr<AudioState> audio_state() { return audio_state_; }
105 MockVoEChannelProxy* channel_proxy() { return channel_proxy_; } 108 MockVoEChannelProxy* channel_proxy() { return channel_proxy_; }
106 CongestionController* congestion_controller() { 109 CongestionController* congestion_controller() {
107 return &congestion_controller_; 110 return &congestion_controller_;
108 } 111 }
109 BitrateAllocator* bitrate_allocator() { return &bitrate_allocator_; } 112 BitrateAllocator* bitrate_allocator() { return &bitrate_allocator_; }
110 rtc::TaskQueue* worker_queue() { return &worker_queue_; } 113 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; 387 stream_config.send_codec_spec.cng_plfreq = 8000;
385 stream_config.send_codec_spec.cng_payload_type = 105; 388 stream_config.send_codec_spec.cng_payload_type = 105;
386 EXPECT_CALL(*helper.voice_engine(), SetVADStatus(kChannelId, true, _, _)) 389 EXPECT_CALL(*helper.voice_engine(), SetVADStatus(kChannelId, true, _, _))
387 .WillOnce(Return(0)); 390 .WillOnce(Return(0));
388 internal::AudioSendStream send_stream( 391 internal::AudioSendStream send_stream(
389 stream_config, helper.audio_state(), helper.worker_queue(), 392 stream_config, helper.audio_state(), helper.worker_queue(),
390 helper.congestion_controller(), helper.bitrate_allocator(), 393 helper.congestion_controller(), helper.bitrate_allocator(),
391 helper.event_log()); 394 helper.event_log());
392 } 395 }
393 396
397 TEST(AudioSendStreamTest, DoesNotPassHigherBitrateThanMaxBitrate) {
398 ConfigHelper helper;
399 internal::AudioSendStream send_stream(
400 helper.config(), helper.audio_state(), helper.worker_queue(),
401 helper.congestion_controller(), helper.bitrate_allocator(),
402 helper.event_log());
403 EXPECT_CALL(*helper.channel_proxy(),
404 SetBitrate(helper.config().max_bitrate_bps, _));
405 send_stream.OnBitrateUpdated(helper.config().max_bitrate_bps + 5000, 0.0, 50,
406 6000);
407 }
408
409 TEST(AudioSendStreamTest, ProbingIntervalOnBitrateUpdated) {
410 ConfigHelper helper;
411 internal::AudioSendStream send_stream(
412 helper.config(), helper.audio_state(), helper.worker_queue(),
413 helper.congestion_controller(), helper.bitrate_allocator(),
414 helper.event_log());
415 EXPECT_CALL(*helper.channel_proxy(), SetBitrate(_, 5000));
416 send_stream.OnBitrateUpdated(50000, 0.0, 50, 5000);
417
418 EXPECT_CALL(*helper.channel_proxy(),
419 SetBitrate(helper.config().max_bitrate_bps, 6000));
420 send_stream.OnBitrateUpdated(helper.config().max_bitrate_bps + 5000, 0.0, 50,
421 6000);
422 }
minyue-webrtc 2016/11/22 10:14:25 what does 418-421 try to test?
michaelt 2016/11/22 16:29:00 The the general idea is to test if the correct pro
423
394 } // namespace test 424 } // namespace test
395 } // namespace webrtc 425 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698