Fredrik Solenberg | 2a87797 | 2017-12-15 16:42:15 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015 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 CALL_TEST_MOCK_AUDIO_SEND_STREAM_H_ |
| 12 | #define CALL_TEST_MOCK_AUDIO_SEND_STREAM_H_ |
| 13 | |
| 14 | #include <memory> |
| 15 | |
| 16 | #include "call/audio_send_stream.h" |
| 17 | #include "test/gmock.h" |
| 18 | |
| 19 | namespace webrtc { |
| 20 | namespace test { |
| 21 | |
| 22 | class MockAudioSendStream : public AudioSendStream { |
| 23 | public: |
| 24 | MOCK_CONST_METHOD0(GetConfig, const webrtc::AudioSendStream::Config&()); |
| 25 | MOCK_METHOD1(Reconfigure, void(const Config& config)); |
| 26 | MOCK_METHOD0(Start, void()); |
| 27 | MOCK_METHOD0(Stop, void()); |
| 28 | // GMock doesn't like move-only types, such as std::unique_ptr. |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 29 | virtual void SendAudioData(std::unique_ptr<webrtc::AudioFrame> audio_frame) { |
Fredrik Solenberg | 2a87797 | 2017-12-15 16:42:15 +0100 | [diff] [blame] | 30 | SendAudioDataForMock(audio_frame.get()); |
| 31 | } |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 32 | MOCK_METHOD1(SendAudioDataForMock, void(webrtc::AudioFrame* audio_frame)); |
Fredrik Solenberg | 2a87797 | 2017-12-15 16:42:15 +0100 | [diff] [blame] | 33 | MOCK_METHOD4(SendTelephoneEvent, |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 34 | bool(int payload_type, |
| 35 | int payload_frequency, |
| 36 | int event, |
Fredrik Solenberg | 2a87797 | 2017-12-15 16:42:15 +0100 | [diff] [blame] | 37 | int duration_ms)); |
| 38 | MOCK_METHOD1(SetMuted, void(bool muted)); |
| 39 | MOCK_CONST_METHOD0(GetStats, Stats()); |
| 40 | MOCK_CONST_METHOD1(GetStats, Stats(bool has_remote_tracks)); |
| 41 | }; |
| 42 | } // namespace test |
| 43 | } // namespace webrtc |
| 44 | |
| 45 | #endif // CALL_TEST_MOCK_AUDIO_SEND_STREAM_H_ |