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

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

Issue 2904893002: Revert of Activate 'offload debug dump recordings from audio thread to TaskQueue'. (Closed)
Patch Set: Created 3 years, 6 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());
129 StrictMock<MockTransmitMixer> transmit_mixer; 128 StrictMock<MockTransmitMixer> transmit_mixer;
130 EXPECT_CALL(transmit_mixer, EnableStereoChannelSwapping(false)); 129 EXPECT_CALL(transmit_mixer, EnableStereoChannelSwapping(false));
131 cricket::FakeWebRtcVoiceEngine voe(&apm, &transmit_mixer); 130 cricket::FakeWebRtcVoiceEngine voe(&apm, &transmit_mixer);
132 EXPECT_FALSE(voe.IsInited()); 131 EXPECT_FALSE(voe.IsInited());
133 { 132 {
134 cricket::WebRtcVoiceEngine engine( 133 cricket::WebRtcVoiceEngine engine(
135 &adm, webrtc::MockAudioEncoderFactory::CreateUnusedFactory(), 134 &adm, webrtc::MockAudioEncoderFactory::CreateUnusedFactory(),
136 webrtc::MockAudioDecoderFactory::CreateUnusedFactory(), nullptr, 135 webrtc::MockAudioDecoderFactory::CreateUnusedFactory(), nullptr,
137 new FakeVoEWrapper(&voe)); 136 new FakeVoEWrapper(&voe));
138 EXPECT_TRUE(voe.IsInited()); 137 EXPECT_TRUE(voe.IsInited());
(...skipping 18 matching lines...) Expand all
157 : apm_gc_(*apm_.gain_control()), apm_ec_(*apm_.echo_cancellation()), 156 : apm_gc_(*apm_.gain_control()), apm_ec_(*apm_.echo_cancellation()),
158 apm_ns_(*apm_.noise_suppression()), apm_vd_(*apm_.voice_detection()), 157 apm_ns_(*apm_.noise_suppression()), apm_vd_(*apm_.voice_detection()),
159 call_(webrtc::Call::Config(&event_log_)), voe_(&apm_, &transmit_mixer_), 158 call_(webrtc::Call::Config(&event_log_)), voe_(&apm_, &transmit_mixer_),
160 override_field_trials_(field_trials) { 159 override_field_trials_(field_trials) {
161 // AudioDeviceModule. 160 // AudioDeviceModule.
162 AdmSetupExpectations(&adm_); 161 AdmSetupExpectations(&adm_);
163 // AudioProcessing. 162 // AudioProcessing.
164 EXPECT_CALL(apm_, ApplyConfig(testing::_)); 163 EXPECT_CALL(apm_, ApplyConfig(testing::_));
165 EXPECT_CALL(apm_, SetExtraOptions(testing::_)); 164 EXPECT_CALL(apm_, SetExtraOptions(testing::_));
166 EXPECT_CALL(apm_, Initialize()).WillOnce(Return(0)); 165 EXPECT_CALL(apm_, Initialize()).WillOnce(Return(0));
167 EXPECT_CALL(apm_, DetachAecDump());
168 // Default Options. 166 // Default Options.
169 EXPECT_CALL(apm_ec_, Enable(true)).WillOnce(Return(0)); 167 EXPECT_CALL(apm_ec_, Enable(true)).WillOnce(Return(0));
170 EXPECT_CALL(apm_ec_, enable_metrics(true)).WillOnce(Return(0)); 168 EXPECT_CALL(apm_ec_, enable_metrics(true)).WillOnce(Return(0));
171 EXPECT_CALL(apm_gc_, Enable(true)).WillOnce(Return(0)); 169 EXPECT_CALL(apm_gc_, Enable(true)).WillOnce(Return(0));
172 EXPECT_CALL(apm_ns_, Enable(true)).WillOnce(Return(0)); 170 EXPECT_CALL(apm_ns_, Enable(true)).WillOnce(Return(0));
173 EXPECT_CALL(apm_vd_, Enable(true)).WillOnce(Return(0)); 171 EXPECT_CALL(apm_vd_, Enable(true)).WillOnce(Return(0));
174 EXPECT_CALL(transmit_mixer_, EnableStereoChannelSwapping(false)); 172 EXPECT_CALL(transmit_mixer_, EnableStereoChannelSwapping(false));
175 // Init does not overwrite default AGC config. 173 // Init does not overwrite default AGC config.
176 EXPECT_CALL(apm_gc_, target_level_dbfs()).WillOnce(Return(1)); 174 EXPECT_CALL(apm_gc_, target_level_dbfs()).WillOnce(Return(1));
177 EXPECT_CALL(apm_gc_, compression_gain_db()).WillRepeatedly(Return(5)); 175 EXPECT_CALL(apm_gc_, compression_gain_db()).WillRepeatedly(Return(5));
(...skipping 3276 matching lines...) Expand 10 before | Expand all | Expand 10 after
3454 // Without this cast, the comparison turned unsigned and, thus, failed for -1. 3452 // Without this cast, the comparison turned unsigned and, thus, failed for -1.
3455 const int num_specs = static_cast<int>(specs.size()); 3453 const int num_specs = static_cast<int>(specs.size());
3456 EXPECT_GE(find_codec({"cn", 8000, 1}), num_specs); 3454 EXPECT_GE(find_codec({"cn", 8000, 1}), num_specs);
3457 EXPECT_GE(find_codec({"cn", 16000, 1}), num_specs); 3455 EXPECT_GE(find_codec({"cn", 16000, 1}), num_specs);
3458 EXPECT_EQ(find_codec({"cn", 32000, 1}), -1); 3456 EXPECT_EQ(find_codec({"cn", 32000, 1}), -1);
3459 EXPECT_GE(find_codec({"telephone-event", 8000, 1}), num_specs); 3457 EXPECT_GE(find_codec({"telephone-event", 8000, 1}), num_specs);
3460 EXPECT_GE(find_codec({"telephone-event", 16000, 1}), num_specs); 3458 EXPECT_GE(find_codec({"telephone-event", 16000, 1}), num_specs);
3461 EXPECT_GE(find_codec({"telephone-event", 32000, 1}), num_specs); 3459 EXPECT_GE(find_codec({"telephone-event", 32000, 1}), num_specs);
3462 EXPECT_GE(find_codec({"telephone-event", 48000, 1}), num_specs); 3460 EXPECT_GE(find_codec({"telephone-event", 48000, 1}), num_specs);
3463 } 3461 }
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