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

Side by Side Diff: webrtc/media/engine/webrtcvoiceengine_unittest.cc

Issue 2896813002: Activate 'offload debug dump recordings from audio thread to TaskQueue'. (Closed)
Patch Set: Give queue shorter name. Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « webrtc/media/engine/webrtcvoiceengine.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2008 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2008 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 } // namespace 118 } // namespace
119 119
120 // Tests that our stub library "works". 120 // Tests that our stub library "works".
121 TEST(WebRtcVoiceEngineTestStubLibrary, StartupShutdown) { 121 TEST(WebRtcVoiceEngineTestStubLibrary, StartupShutdown) {
122 StrictMock<webrtc::test::MockAudioDeviceModule> adm; 122 StrictMock<webrtc::test::MockAudioDeviceModule> adm;
123 AdmSetupExpectations(&adm); 123 AdmSetupExpectations(&adm);
124 StrictMock<webrtc::test::MockAudioProcessing> apm; 124 StrictMock<webrtc::test::MockAudioProcessing> apm;
125 EXPECT_CALL(apm, ApplyConfig(testing::_)); 125 EXPECT_CALL(apm, ApplyConfig(testing::_));
126 EXPECT_CALL(apm, SetExtraOptions(testing::_)); 126 EXPECT_CALL(apm, SetExtraOptions(testing::_));
127 EXPECT_CALL(apm, Initialize()).WillOnce(Return(0)); 127 EXPECT_CALL(apm, Initialize()).WillOnce(Return(0));
128 EXPECT_CALL(apm, DetachAecDump());
128 StrictMock<MockTransmitMixer> transmit_mixer; 129 StrictMock<MockTransmitMixer> transmit_mixer;
129 EXPECT_CALL(transmit_mixer, EnableStereoChannelSwapping(false)); 130 EXPECT_CALL(transmit_mixer, EnableStereoChannelSwapping(false));
130 cricket::FakeWebRtcVoiceEngine voe(&apm, &transmit_mixer); 131 cricket::FakeWebRtcVoiceEngine voe(&apm, &transmit_mixer);
131 EXPECT_FALSE(voe.IsInited()); 132 EXPECT_FALSE(voe.IsInited());
132 { 133 {
133 cricket::WebRtcVoiceEngine engine( 134 cricket::WebRtcVoiceEngine engine(
134 &adm, webrtc::MockAudioEncoderFactory::CreateUnusedFactory(), 135 &adm, webrtc::MockAudioEncoderFactory::CreateUnusedFactory(),
135 webrtc::MockAudioDecoderFactory::CreateUnusedFactory(), nullptr, 136 webrtc::MockAudioDecoderFactory::CreateUnusedFactory(), nullptr,
136 new FakeVoEWrapper(&voe)); 137 new FakeVoEWrapper(&voe));
137 EXPECT_TRUE(voe.IsInited()); 138 EXPECT_TRUE(voe.IsInited());
(...skipping 18 matching lines...) Expand all
156 : apm_gc_(*apm_.gain_control()), apm_ec_(*apm_.echo_cancellation()), 157 : apm_gc_(*apm_.gain_control()), apm_ec_(*apm_.echo_cancellation()),
157 apm_ns_(*apm_.noise_suppression()), apm_vd_(*apm_.voice_detection()), 158 apm_ns_(*apm_.noise_suppression()), apm_vd_(*apm_.voice_detection()),
158 call_(webrtc::Call::Config(&event_log_)), voe_(&apm_, &transmit_mixer_), 159 call_(webrtc::Call::Config(&event_log_)), voe_(&apm_, &transmit_mixer_),
159 override_field_trials_(field_trials) { 160 override_field_trials_(field_trials) {
160 // AudioDeviceModule. 161 // AudioDeviceModule.
161 AdmSetupExpectations(&adm_); 162 AdmSetupExpectations(&adm_);
162 // AudioProcessing. 163 // AudioProcessing.
163 EXPECT_CALL(apm_, ApplyConfig(testing::_)); 164 EXPECT_CALL(apm_, ApplyConfig(testing::_));
164 EXPECT_CALL(apm_, SetExtraOptions(testing::_)); 165 EXPECT_CALL(apm_, SetExtraOptions(testing::_));
165 EXPECT_CALL(apm_, Initialize()).WillOnce(Return(0)); 166 EXPECT_CALL(apm_, Initialize()).WillOnce(Return(0));
167 EXPECT_CALL(apm_, DetachAecDump());
166 // Default Options. 168 // Default Options.
167 EXPECT_CALL(apm_ec_, Enable(true)).WillOnce(Return(0)); 169 EXPECT_CALL(apm_ec_, Enable(true)).WillOnce(Return(0));
168 EXPECT_CALL(apm_ec_, enable_metrics(true)).WillOnce(Return(0)); 170 EXPECT_CALL(apm_ec_, enable_metrics(true)).WillOnce(Return(0));
169 EXPECT_CALL(apm_gc_, Enable(true)).WillOnce(Return(0)); 171 EXPECT_CALL(apm_gc_, Enable(true)).WillOnce(Return(0));
170 EXPECT_CALL(apm_ns_, Enable(true)).WillOnce(Return(0)); 172 EXPECT_CALL(apm_ns_, Enable(true)).WillOnce(Return(0));
171 EXPECT_CALL(apm_vd_, Enable(true)).WillOnce(Return(0)); 173 EXPECT_CALL(apm_vd_, Enable(true)).WillOnce(Return(0));
172 EXPECT_CALL(transmit_mixer_, EnableStereoChannelSwapping(false)); 174 EXPECT_CALL(transmit_mixer_, EnableStereoChannelSwapping(false));
173 // Init does not overwrite default AGC config. 175 // Init does not overwrite default AGC config.
174 EXPECT_CALL(apm_gc_, target_level_dbfs()).WillOnce(Return(1)); 176 EXPECT_CALL(apm_gc_, target_level_dbfs()).WillOnce(Return(1));
175 EXPECT_CALL(apm_gc_, compression_gain_db()).WillRepeatedly(Return(5)); 177 EXPECT_CALL(apm_gc_, compression_gain_db()).WillRepeatedly(Return(5));
(...skipping 3276 matching lines...) Expand 10 before | Expand all | Expand 10 after
3452 // Without this cast, the comparison turned unsigned and, thus, failed for -1. 3454 // Without this cast, the comparison turned unsigned and, thus, failed for -1.
3453 const int num_specs = static_cast<int>(specs.size()); 3455 const int num_specs = static_cast<int>(specs.size());
3454 EXPECT_GE(find_codec({"cn", 8000, 1}), num_specs); 3456 EXPECT_GE(find_codec({"cn", 8000, 1}), num_specs);
3455 EXPECT_GE(find_codec({"cn", 16000, 1}), num_specs); 3457 EXPECT_GE(find_codec({"cn", 16000, 1}), num_specs);
3456 EXPECT_EQ(find_codec({"cn", 32000, 1}), -1); 3458 EXPECT_EQ(find_codec({"cn", 32000, 1}), -1);
3457 EXPECT_GE(find_codec({"telephone-event", 8000, 1}), num_specs); 3459 EXPECT_GE(find_codec({"telephone-event", 8000, 1}), num_specs);
3458 EXPECT_GE(find_codec({"telephone-event", 16000, 1}), num_specs); 3460 EXPECT_GE(find_codec({"telephone-event", 16000, 1}), num_specs);
3459 EXPECT_GE(find_codec({"telephone-event", 32000, 1}), num_specs); 3461 EXPECT_GE(find_codec({"telephone-event", 32000, 1}), num_specs);
3460 EXPECT_GE(find_codec({"telephone-event", 48000, 1}), num_specs); 3462 EXPECT_GE(find_codec({"telephone-event", 48000, 1}), num_specs);
3461 } 3463 }
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcvoiceengine.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698