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_METHOD(const webrtc::AudioSendStream::Config&, 25 GetConfig, 26 (), 27 (const, override)); 28 MOCK_METHOD(void, Reconfigure, (const Config& config), (override)); 29 MOCK_METHOD(void, Start, (), (override)); 30 MOCK_METHOD(void, Stop, (), (override)); 31 // GMock doesn't like move-only types, such as std::unique_ptr. SendAudioData(std::unique_ptr<webrtc::AudioFrame> audio_frame)32 void SendAudioData(std::unique_ptr<webrtc::AudioFrame> audio_frame) override { 33 SendAudioDataForMock(audio_frame.get()); 34 } 35 MOCK_METHOD(void, SendAudioDataForMock, (webrtc::AudioFrame*)); 36 MOCK_METHOD( 37 bool, 38 SendTelephoneEvent, 39 (int payload_type, int payload_frequency, int event, int duration_ms), 40 (override)); 41 MOCK_METHOD(void, SetMuted, (bool muted), (override)); 42 MOCK_METHOD(Stats, GetStats, (), (const, override)); 43 MOCK_METHOD(Stats, GetStats, (bool has_remote_tracks), (const, override)); 44 }; 45 } // namespace test 46 } // namespace webrtc 47 48 #endif // CALL_TEST_MOCK_AUDIO_SEND_STREAM_H_ 49