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