• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright (c) 2016 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 MODULES_AUDIO_DEVICE_INCLUDE_MOCK_AUDIO_TRANSPORT_H_
12 #define MODULES_AUDIO_DEVICE_INCLUDE_MOCK_AUDIO_TRANSPORT_H_
13 
14 #include "modules/audio_device/include/audio_device_defines.h"
15 #include "test/gmock.h"
16 
17 namespace webrtc {
18 namespace test {
19 
20 class MockAudioTransport : public AudioTransport {
21  public:
MockAudioTransport()22   MockAudioTransport() {}
~MockAudioTransport()23   ~MockAudioTransport() {}
24 
25   MOCK_METHOD(int32_t,
26               RecordedDataIsAvailable,
27               (const void* audioSamples,
28                const size_t nSamples,
29                const size_t nBytesPerSample,
30                const size_t nChannels,
31                const uint32_t samplesPerSec,
32                const uint32_t totalDelayMS,
33                const int32_t clockDrift,
34                const uint32_t currentMicLevel,
35                const bool keyPressed,
36                uint32_t& newMicLevel),
37               (override));
38 
39   MOCK_METHOD(int32_t,
40               NeedMorePlayData,
41               (const size_t nSamples,
42                const size_t nBytesPerSample,
43                const size_t nChannels,
44                const uint32_t samplesPerSec,
45                void* audioSamples,
46                size_t& nSamplesOut,
47                int64_t* elapsed_time_ms,
48                int64_t* ntp_time_ms),
49               (override));
50 
51   MOCK_METHOD(void,
52               PullRenderData,
53               (int bits_per_sample,
54                int sample_rate,
55                size_t number_of_channels,
56                size_t number_of_frames,
57                void* audio_data,
58                int64_t* elapsed_time_ms,
59                int64_t* ntp_time_ms),
60               (override));
61 };
62 
63 }  // namespace test
64 }  // namespace webrtc
65 
66 #endif  // MODULES_AUDIO_DEVICE_INCLUDE_MOCK_AUDIO_TRANSPORT_H_
67