blob: 4164dd550e119d1083edca1c6567e277e9481e53 [file] [log] [blame]
Fredrik Solenberg2a877972017-12-15 16:42:15 +01001/*
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
19namespace webrtc {
20namespace test {
21
22class MockAudioSendStream : public AudioSendStream {
23 public:
Danil Chapovalov9a5efe92020-05-14 22:06:18 +020024 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));
Fredrik Solenberg2a877972017-12-15 16:42:15 +010031 // GMock doesn't like move-only types, such as std::unique_ptr.
Danil Chapovalov9a5efe92020-05-14 22:06:18 +020032 void SendAudioData(std::unique_ptr<webrtc::AudioFrame> audio_frame) override {
Fredrik Solenberg2a877972017-12-15 16:42:15 +010033 SendAudioDataForMock(audio_frame.get());
34 }
Danil Chapovalov9a5efe92020-05-14 22:06:18 +020035 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));
Fredrik Solenberg2a877972017-12-15 16:42:15 +010044};
45} // namespace test
46} // namespace webrtc
47
48#endif // CALL_TEST_MOCK_AUDIO_SEND_STREAM_H_