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

Side by Side Diff: webrtc/modules/audio_processing/include/mock_audio_processing.h

Issue 2985633002: Avoid that previous settings in APM are overwritten by WebRtcVoiceEngine (Closed)
Patch Set: Corrected unittest behavior relying on sticky settings Created 3 years, 4 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_unittest.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) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 virtual ~MockAudioProcessing() {} 132 virtual ~MockAudioProcessing() {}
133 133
134 MOCK_METHOD0(Initialize, int()); 134 MOCK_METHOD0(Initialize, int());
135 MOCK_METHOD6(Initialize, int(int capture_input_sample_rate_hz, 135 MOCK_METHOD6(Initialize, int(int capture_input_sample_rate_hz,
136 int capture_output_sample_rate_hz, 136 int capture_output_sample_rate_hz,
137 int render_sample_rate_hz, 137 int render_sample_rate_hz,
138 ChannelLayout capture_input_layout, 138 ChannelLayout capture_input_layout,
139 ChannelLayout capture_output_layout, 139 ChannelLayout capture_output_layout,
140 ChannelLayout render_input_layout)); 140 ChannelLayout render_input_layout));
141 MOCK_METHOD1(Initialize, int(const ProcessingConfig& processing_config)); 141 MOCK_METHOD1(Initialize, int(const ProcessingConfig& processing_config));
142 MOCK_METHOD1(ApplyConfig, void(const Config& config)); 142 virtual void ApplyConfig(const webrtc::AudioProcessing::Config& config) {
143 apm_config_ = config;
144 }
Taylor Brandstetter 2017/07/25 00:04:37 This is now partly a fake and partly a mock; I thi
peah-webrtc 2017/07/25 21:40:21 Very valid point! And thanks for the suggestions a
143 MOCK_METHOD1(SetExtraOptions, void(const webrtc::Config& config)); 145 MOCK_METHOD1(SetExtraOptions, void(const webrtc::Config& config));
144 MOCK_CONST_METHOD0(proc_sample_rate_hz, int()); 146 MOCK_CONST_METHOD0(proc_sample_rate_hz, int());
145 MOCK_CONST_METHOD0(proc_split_sample_rate_hz, int()); 147 MOCK_CONST_METHOD0(proc_split_sample_rate_hz, int());
146 MOCK_CONST_METHOD0(num_input_channels, size_t()); 148 MOCK_CONST_METHOD0(num_input_channels, size_t());
147 MOCK_CONST_METHOD0(num_proc_channels, size_t()); 149 MOCK_CONST_METHOD0(num_proc_channels, size_t());
148 MOCK_CONST_METHOD0(num_output_channels, size_t()); 150 MOCK_CONST_METHOD0(num_output_channels, size_t());
149 MOCK_CONST_METHOD0(num_reverse_channels, size_t()); 151 MOCK_CONST_METHOD0(num_reverse_channels, size_t());
150 MOCK_METHOD1(set_output_will_be_muted, void(bool muted)); 152 MOCK_METHOD1(set_output_will_be_muted, void(bool muted));
151 MOCK_METHOD1(ProcessStream, int(AudioFrame* frame)); 153 MOCK_METHOD1(ProcessStream, int(AudioFrame* frame));
152 MOCK_METHOD7(ProcessStream, int(const float* const* src, 154 MOCK_METHOD7(ProcessStream, int(const float* const* src,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 virtual MockLevelEstimator* level_estimator() const { 206 virtual MockLevelEstimator* level_estimator() const {
205 return level_estimator_.get(); 207 return level_estimator_.get();
206 } 208 }
207 virtual MockNoiseSuppression* noise_suppression() const { 209 virtual MockNoiseSuppression* noise_suppression() const {
208 return noise_suppression_.get(); 210 return noise_suppression_.get();
209 } 211 }
210 virtual MockVoiceDetection* voice_detection() const { 212 virtual MockVoiceDetection* voice_detection() const {
211 return voice_detection_.get(); 213 return voice_detection_.get();
212 } 214 }
213 215
214 MOCK_CONST_METHOD0(GetConfig, AudioProcessing::Config()); 216 virtual webrtc::AudioProcessing::Config GetConfig() const {
217 return apm_config_;
218 }
215 219
216 private: 220 private:
217 std::unique_ptr<MockEchoCancellation> echo_cancellation_; 221 std::unique_ptr<MockEchoCancellation> echo_cancellation_;
218 std::unique_ptr<MockEchoControlMobile> echo_control_mobile_; 222 std::unique_ptr<MockEchoControlMobile> echo_control_mobile_;
219 std::unique_ptr<MockGainControl> gain_control_; 223 std::unique_ptr<MockGainControl> gain_control_;
220 std::unique_ptr<MockHighPassFilter> high_pass_filter_; 224 std::unique_ptr<MockHighPassFilter> high_pass_filter_;
221 std::unique_ptr<MockLevelEstimator> level_estimator_; 225 std::unique_ptr<MockLevelEstimator> level_estimator_;
222 std::unique_ptr<MockNoiseSuppression> noise_suppression_; 226 std::unique_ptr<MockNoiseSuppression> noise_suppression_;
223 std::unique_ptr<MockVoiceDetection> voice_detection_; 227 std::unique_ptr<MockVoiceDetection> voice_detection_;
228 webrtc::AudioProcessing::Config apm_config_;
224 }; 229 };
225 230
226 } // namespace test 231 } // namespace test
227 } // namespace webrtc 232 } // namespace webrtc
228 233
229 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_MOCK_AUDIO_PROCESSING_H_ 234 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_MOCK_AUDIO_PROCESSING_H_
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcvoiceengine_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698