Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | |
| 3 * | |
| 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 | |
| 6 * tree. An additional intellectual property rights grant can be found | |
| 7 * in the file PATENTS. All contributing project authors may | |
| 8 * be found in the AUTHORS file in the root of the source tree. | |
| 9 */ | |
| 10 | |
| 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_MOCK_WAVREADE R_H_ | |
| 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_MOCK_WAVREADE R_H_ | |
| 13 | |
| 14 #include <cstddef> | |
| 15 #include <string> | |
| 16 | |
| 17 #include "webrtc/modules/audio_processing/test/conversational_speech/wavreader_i nterface.h" | |
| 18 #include "webrtc/test/gmock.h" | |
| 19 #include "webrtc/typedefs.h" | |
| 20 | |
| 21 namespace webrtc { | |
| 22 namespace test { | |
| 23 namespace conversational_speech { | |
| 24 | |
| 25 class MockWavReader : public WavReaderInterface { | |
| 26 public: | |
| 27 MockWavReader( | |
| 28 int sample_rate, size_t num_channels, size_t num_samples) | |
| 29 : sample_rate_(sample_rate), num_channels_(num_channels), | |
| 30 num_samples_(num_samples) {} | |
| 31 ~MockWavReader() = default; | |
| 32 | |
| 33 // TOOD(alessiob): use ON_CALL to return random samples. | |
| 34 MOCK_METHOD2(ReadFloatSamples, size_t(size_t, float*)); | |
| 35 MOCK_METHOD2(ReadInt16Samples, size_t(size_t, int16_t*)); | |
| 36 | |
| 37 // TOOD(alessiob): use ON_CALL to return properties. | |
| 38 MOCK_CONST_METHOD0(sample_rate, int()); | |
| 39 MOCK_CONST_METHOD0(num_channels, size_t()); | |
| 40 MOCK_CONST_METHOD0(num_samples, size_t()); | |
| 41 | |
| 42 private: | |
| 43 int sample_rate_; | |
|
hlundin-webrtc
2017/03/27 09:46:35
Make these consts if you can.
AleBzk
2017/03/27 11:17:06
Done.
| |
| 44 size_t num_channels_; | |
| 45 size_t num_samples_; | |
| 46 }; | |
| 47 | |
| 48 } // namespace conversational_speech | |
| 49 } // namespace test | |
| 50 } // namespace webrtc | |
| 51 | |
| 52 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_MOCK_WAVRE ADER_H_ | |
| OLD | NEW |