blob: 489e826d0eb47016923856349d8f17bbb44fb96d [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:
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 Gerey665174f2018-06-19 15:03:05 +020029 virtual void SendAudioData(std::unique_ptr<webrtc::AudioFrame> audio_frame) {
Fredrik Solenberg2a877972017-12-15 16:42:15 +010030 SendAudioDataForMock(audio_frame.get());
31 }
Yves Gerey665174f2018-06-19 15:03:05 +020032 MOCK_METHOD1(SendAudioDataForMock, void(webrtc::AudioFrame* audio_frame));
Fredrik Solenberg2a877972017-12-15 16:42:15 +010033 MOCK_METHOD4(SendTelephoneEvent,
Yves Gerey665174f2018-06-19 15:03:05 +020034 bool(int payload_type,
35 int payload_frequency,
36 int event,
Fredrik Solenberg2a877972017-12-15 16:42:15 +010037 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_