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

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

Issue 2747123007: Test submission of complete AEC-dump refactoring. (Closed)
Patch Set: Changed interface and build structure after reviewer comments. Created 3 years, 8 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
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
11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_MOCK_AUDIO_PROCESSING_H_ 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_MOCK_AUDIO_PROCESSING_H_
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_MOCK_AUDIO_PROCESSING_H_ 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_MOCK_AUDIO_PROCESSING_H_
13 13
14 #include <memory> 14 #include <memory>
15 15
16 #include "webrtc/modules/audio_processing/include/aec_dump.h"
16 #include "webrtc/modules/audio_processing/include/audio_processing.h" 17 #include "webrtc/modules/audio_processing/include/audio_processing.h"
17 #include "webrtc/test/gmock.h" 18 #include "webrtc/test/gmock.h"
18 19
19 namespace webrtc { 20 namespace webrtc {
20 21
21 namespace test { 22 namespace test {
22 23
23 class MockEchoCancellation : public EchoCancellation { 24 class MockEchoCancellation : public EchoCancellation {
24 public: 25 public:
25 virtual ~MockEchoCancellation() {} 26 virtual ~MockEchoCancellation() {}
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 MOCK_METHOD4(ProcessReverseStream, int(const float* const* src, 168 MOCK_METHOD4(ProcessReverseStream, int(const float* const* src,
168 const StreamConfig& input_config, 169 const StreamConfig& input_config,
169 const StreamConfig& output_config, 170 const StreamConfig& output_config,
170 float* const* dest)); 171 float* const* dest));
171 MOCK_METHOD1(set_stream_delay_ms, int(int delay)); 172 MOCK_METHOD1(set_stream_delay_ms, int(int delay));
172 MOCK_CONST_METHOD0(stream_delay_ms, int()); 173 MOCK_CONST_METHOD0(stream_delay_ms, int());
173 MOCK_CONST_METHOD0(was_stream_delay_set, bool()); 174 MOCK_CONST_METHOD0(was_stream_delay_set, bool());
174 MOCK_METHOD1(set_stream_key_pressed, void(bool key_pressed)); 175 MOCK_METHOD1(set_stream_key_pressed, void(bool key_pressed));
175 MOCK_METHOD1(set_delay_offset_ms, void(int offset)); 176 MOCK_METHOD1(set_delay_offset_ms, void(int offset));
176 MOCK_CONST_METHOD0(delay_offset_ms, int()); 177 MOCK_CONST_METHOD0(delay_offset_ms, int());
177 MOCK_METHOD2(StartDebugRecording, int(const char filename[kMaxFilenameSize], 178 // MOCK_METHOD1(StartDebugRecording,
178 int64_t max_log_size_bytes)); 179 // void(std::unique_ptr<AecDump> aec_dump));
179 MOCK_METHOD2(StartDebugRecording, int(FILE* handle, 180 MOCK_METHOD0(StopDebugRecording, void());
180 int64_t max_log_size_bytes));
181 MOCK_METHOD1(StartDebugRecording, int (FILE* handle));
182 MOCK_METHOD1(StartDebugRecordingForPlatformFile,
183 int(rtc::PlatformFile handle));
184 MOCK_METHOD0(StopDebugRecording, int());
185 MOCK_METHOD0(UpdateHistogramsOnCallEnd, void()); 181 MOCK_METHOD0(UpdateHistogramsOnCallEnd, void());
186 MOCK_CONST_METHOD0(GetStatistics, AudioProcessingStatistics()); 182 MOCK_CONST_METHOD0(GetStatistics, AudioProcessingStatistics());
187 virtual MockEchoCancellation* echo_cancellation() const { 183 virtual MockEchoCancellation* echo_cancellation() const {
188 return echo_cancellation_.get(); 184 return echo_cancellation_.get();
189 } 185 }
190 virtual MockEchoControlMobile* echo_control_mobile() const { 186 virtual MockEchoControlMobile* echo_control_mobile() const {
191 return echo_control_mobile_.get(); 187 return echo_control_mobile_.get();
192 } 188 }
193 virtual MockGainControl* gain_control() const { 189 virtual MockGainControl* gain_control() const {
194 return gain_control_.get(); 190 return gain_control_.get();
195 } 191 }
196 virtual MockHighPassFilter* high_pass_filter() const { 192 virtual MockHighPassFilter* high_pass_filter() const {
197 return high_pass_filter_.get(); 193 return high_pass_filter_.get();
198 } 194 }
199 virtual MockLevelEstimator* level_estimator() const { 195 virtual MockLevelEstimator* level_estimator() const {
200 return level_estimator_.get(); 196 return level_estimator_.get();
201 } 197 }
202 virtual MockNoiseSuppression* noise_suppression() const { 198 virtual MockNoiseSuppression* noise_suppression() const {
203 return noise_suppression_.get(); 199 return noise_suppression_.get();
204 } 200 }
205 virtual MockVoiceDetection* voice_detection() const { 201 virtual MockVoiceDetection* voice_detection() const {
206 return voice_detection_.get(); 202 return voice_detection_.get();
207 } 203 }
208 204
205 virtual void StartDebugRecording(std::unique_ptr<AecDump> aec_dump) {}
206
209 private: 207 private:
210 std::unique_ptr<MockEchoCancellation> echo_cancellation_; 208 std::unique_ptr<MockEchoCancellation> echo_cancellation_;
211 std::unique_ptr<MockEchoControlMobile> echo_control_mobile_; 209 std::unique_ptr<MockEchoControlMobile> echo_control_mobile_;
212 std::unique_ptr<MockGainControl> gain_control_; 210 std::unique_ptr<MockGainControl> gain_control_;
213 std::unique_ptr<MockHighPassFilter> high_pass_filter_; 211 std::unique_ptr<MockHighPassFilter> high_pass_filter_;
214 std::unique_ptr<MockLevelEstimator> level_estimator_; 212 std::unique_ptr<MockLevelEstimator> level_estimator_;
215 std::unique_ptr<MockNoiseSuppression> noise_suppression_; 213 std::unique_ptr<MockNoiseSuppression> noise_suppression_;
216 std::unique_ptr<MockVoiceDetection> voice_detection_; 214 std::unique_ptr<MockVoiceDetection> voice_detection_;
217 }; 215 };
218 216
219 } // namespace test 217 } // namespace test
220 } // namespace webrtc 218 } // namespace webrtc
221 219
222 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_MOCK_AUDIO_PROCESSING_H_ 220 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_MOCK_AUDIO_PROCESSING_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698