blob: 7984e0b5bd6eca0eee2e2e0b6fb875fa9a4a2554 [file] [log] [blame]
solenbergbc37fc82016-04-04 09:54:44 -07001/*
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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef MODULES_AUDIO_DEVICE_INCLUDE_MOCK_AUDIO_DEVICE_H_
12#define MODULES_AUDIO_DEVICE_INCLUDE_MOCK_AUDIO_DEVICE_H_
solenbergbc37fc82016-04-04 09:54:44 -070013
14#include <string>
kwibergac9f8762016-09-30 22:29:43 -070015
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020016#include "modules/audio_device/include/audio_device.h"
17#include "test/gmock.h"
solenbergbc37fc82016-04-04 09:54:44 -070018
19namespace webrtc {
20namespace test {
21
22class MockAudioDeviceModule : public AudioDeviceModule {
23 public:
Fredrik Solenberga32dd012017-10-04 13:27:21 +020024 // RefCounted
Niels Möller6f72f562017-10-19 13:15:17 +020025 MOCK_CONST_METHOD0(AddRef, void());
26 MOCK_CONST_METHOD0(Release, rtc::RefCountReleaseStatus());
solenbergbc37fc82016-04-04 09:54:44 -070027 // AudioDeviceModule.
28 MOCK_CONST_METHOD1(ActiveAudioLayer, int32_t(AudioLayer* audioLayer));
29 MOCK_CONST_METHOD0(LastError, ErrorCode());
solenbergbc37fc82016-04-04 09:54:44 -070030 MOCK_METHOD1(RegisterAudioCallback, int32_t(AudioTransport* audioCallback));
31 MOCK_METHOD0(Init, int32_t());
32 MOCK_METHOD0(Terminate, int32_t());
33 MOCK_CONST_METHOD0(Initialized, bool());
34 MOCK_METHOD0(PlayoutDevices, int16_t());
35 MOCK_METHOD0(RecordingDevices, int16_t());
36 MOCK_METHOD3(PlayoutDeviceName, int32_t(uint16_t index,
37 char name[kAdmMaxDeviceNameSize],
38 char guid[kAdmMaxGuidSize]));
39 MOCK_METHOD3(RecordingDeviceName, int32_t(uint16_t index,
40 char name[kAdmMaxDeviceNameSize],
41 char guid[kAdmMaxGuidSize]));
42 MOCK_METHOD1(SetPlayoutDevice, int32_t(uint16_t index));
43 MOCK_METHOD1(SetPlayoutDevice, int32_t(WindowsDeviceType device));
44 MOCK_METHOD1(SetRecordingDevice, int32_t(uint16_t index));
45 MOCK_METHOD1(SetRecordingDevice, int32_t(WindowsDeviceType device));
46 MOCK_METHOD1(PlayoutIsAvailable, int32_t(bool* available));
47 MOCK_METHOD0(InitPlayout, int32_t());
48 MOCK_CONST_METHOD0(PlayoutIsInitialized, bool());
49 MOCK_METHOD1(RecordingIsAvailable, int32_t(bool* available));
50 MOCK_METHOD0(InitRecording, int32_t());
51 MOCK_CONST_METHOD0(RecordingIsInitialized, bool());
52 MOCK_METHOD0(StartPlayout, int32_t());
53 MOCK_METHOD0(StopPlayout, int32_t());
54 MOCK_CONST_METHOD0(Playing, bool());
55 MOCK_METHOD0(StartRecording, int32_t());
56 MOCK_METHOD0(StopRecording, int32_t());
57 MOCK_CONST_METHOD0(Recording, bool());
58 MOCK_METHOD1(SetAGC, int32_t(bool enable));
59 MOCK_CONST_METHOD0(AGC, bool());
solenbergbc37fc82016-04-04 09:54:44 -070060 MOCK_METHOD0(InitSpeaker, int32_t());
61 MOCK_CONST_METHOD0(SpeakerIsInitialized, bool());
62 MOCK_METHOD0(InitMicrophone, int32_t());
63 MOCK_CONST_METHOD0(MicrophoneIsInitialized, bool());
64 MOCK_METHOD1(SpeakerVolumeIsAvailable, int32_t(bool* available));
65 MOCK_METHOD1(SetSpeakerVolume, int32_t(uint32_t volume));
66 MOCK_CONST_METHOD1(SpeakerVolume, int32_t(uint32_t* volume));
67 MOCK_CONST_METHOD1(MaxSpeakerVolume, int32_t(uint32_t* maxVolume));
68 MOCK_CONST_METHOD1(MinSpeakerVolume, int32_t(uint32_t* minVolume));
solenbergbc37fc82016-04-04 09:54:44 -070069 MOCK_METHOD1(MicrophoneVolumeIsAvailable, int32_t(bool* available));
70 MOCK_METHOD1(SetMicrophoneVolume, int32_t(uint32_t volume));
71 MOCK_CONST_METHOD1(MicrophoneVolume, int32_t(uint32_t* volume));
72 MOCK_CONST_METHOD1(MaxMicrophoneVolume, int32_t(uint32_t* maxVolume));
73 MOCK_CONST_METHOD1(MinMicrophoneVolume, int32_t(uint32_t* minVolume));
solenbergbc37fc82016-04-04 09:54:44 -070074 MOCK_METHOD1(SpeakerMuteIsAvailable, int32_t(bool* available));
75 MOCK_METHOD1(SetSpeakerMute, int32_t(bool enable));
76 MOCK_CONST_METHOD1(SpeakerMute, int32_t(bool* enabled));
77 MOCK_METHOD1(MicrophoneMuteIsAvailable, int32_t(bool* available));
78 MOCK_METHOD1(SetMicrophoneMute, int32_t(bool enable));
79 MOCK_CONST_METHOD1(MicrophoneMute, int32_t(bool* enabled));
solenbergbc37fc82016-04-04 09:54:44 -070080 MOCK_CONST_METHOD1(StereoPlayoutIsAvailable, int32_t(bool* available));
81 MOCK_METHOD1(SetStereoPlayout, int32_t(bool enable));
82 MOCK_CONST_METHOD1(StereoPlayout, int32_t(bool* enabled));
83 MOCK_CONST_METHOD1(StereoRecordingIsAvailable, int32_t(bool* available));
84 MOCK_METHOD1(SetStereoRecording, int32_t(bool enable));
85 MOCK_CONST_METHOD1(StereoRecording, int32_t(bool* enabled));
solenbergbc37fc82016-04-04 09:54:44 -070086 MOCK_CONST_METHOD1(PlayoutDelay, int32_t(uint16_t* delayMS));
solenbergbc37fc82016-04-04 09:54:44 -070087 MOCK_CONST_METHOD0(BuiltInAECIsAvailable, bool());
88 MOCK_CONST_METHOD0(BuiltInAGCIsAvailable, bool());
89 MOCK_CONST_METHOD0(BuiltInNSIsAvailable, bool());
90 MOCK_METHOD1(EnableBuiltInAEC, int32_t(bool enable));
91 MOCK_METHOD1(EnableBuiltInAGC, int32_t(bool enable));
92 MOCK_METHOD1(EnableBuiltInNS, int32_t(bool enable));
maxmorin88e31a32016-08-16 00:56:09 -070093#if defined(WEBRTC_IOS)
solenbergbc37fc82016-04-04 09:54:44 -070094 MOCK_CONST_METHOD1(GetPlayoutAudioParameters, int(AudioParameters* params));
95 MOCK_CONST_METHOD1(GetRecordAudioParameters, int(AudioParameters* params));
maxmorin88e31a32016-08-16 00:56:09 -070096#endif // WEBRTC_IOS
solenbergbc37fc82016-04-04 09:54:44 -070097};
98} // namespace test
99} // namespace webrtc
100
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200101#endif // MODULES_AUDIO_DEVICE_INCLUDE_MOCK_AUDIO_DEVICE_H_