Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | |
|
hlundin-webrtc
2017/01/18 13:08:49
2017
peah-webrtc
2017/01/19 15:33:05
Done.
| |
| 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_AEC3_MOCK_MOCK_RENDER_DELAY_BUFFER_H_ | |
| 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_MOCK_MOCK_RENDER_DELAY_BUFFER_H_ | |
| 13 | |
| 14 #include <vector> | |
| 15 | |
| 16 #include "webrtc/modules/audio_processing/aec3/aec3_constants.h" | |
| 17 #include "webrtc/modules/audio_processing/aec3/render_delay_buffer.h" | |
| 18 #include "webrtc/test/gmock.h" | |
| 19 | |
| 20 namespace webrtc { | |
| 21 namespace test { | |
| 22 | |
| 23 class MockRenderDelayBuffer : public RenderDelayBuffer { | |
| 24 public: | |
| 25 explicit MockRenderDelayBuffer(int sample_rate_hz) | |
| 26 : block_(std::vector<std::vector<float>>( | |
| 27 NumBandsForRate(sample_rate_hz), | |
| 28 std::vector<float>(kBlockSize, 0.f))) {} | |
| 29 virtual ~MockRenderDelayBuffer() = default; | |
| 30 | |
| 31 MOCK_METHOD1(Insert, bool(std::vector<std::vector<float>>* block)); | |
| 32 virtual const std::vector<std::vector<float>>& GetNext() { return block_; } | |
|
hlundin-webrtc
2017/01/18 13:08:49
I think the preferred pattern is to have the mock
peah-webrtc
2017/01/19 15:33:05
Great suggestion!!! Thanks!
Done.
| |
| 33 MOCK_METHOD1(SetDelay, void(size_t delay)); | |
| 34 MOCK_CONST_METHOD0(Delay, size_t()); | |
| 35 MOCK_CONST_METHOD0(MaxDelay, size_t()); | |
| 36 MOCK_CONST_METHOD0(IsBlockAvailable, bool()); | |
| 37 MOCK_CONST_METHOD0(MaxApiJitter, size_t()); | |
| 38 | |
| 39 private: | |
| 40 std::vector<std::vector<float>> block_; | |
| 41 }; | |
| 42 | |
| 43 } // namespace test | |
| 44 } // namespace webrtc | |
| 45 | |
| 46 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_MOCK_MOCK_RENDER_DELAY_BUFFER_H_ | |
| OLD | NEW |