tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

mock_audio_send_stream.h (1812B)


      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 "api/audio/audio_frame.h"
     17 #include "api/rtp_sender_interface.h"
     18 #include "call/audio_send_stream.h"
     19 #include "test/gmock.h"
     20 
     21 namespace webrtc {
     22 namespace test {
     23 
     24 class MockAudioSendStream : public AudioSendStream {
     25 public:
     26  MOCK_METHOD(const webrtc::AudioSendStream::Config&,
     27              GetConfig,
     28              (),
     29              (const, override));
     30  MOCK_METHOD(void,
     31              Reconfigure,
     32              (const Config& config, SetParametersCallback callback),
     33              (override));
     34  MOCK_METHOD(void, Start, (), (override));
     35  MOCK_METHOD(void, Stop, (), (override));
     36  // GMock doesn't like move-only types, such as std::unique_ptr.
     37  void SendAudioData(std::unique_ptr<webrtc::AudioFrame> audio_frame) override {
     38    SendAudioDataForMock(audio_frame.get());
     39  }
     40  MOCK_METHOD(void, SendAudioDataForMock, (webrtc::AudioFrame*));
     41  MOCK_METHOD(
     42      bool,
     43      SendTelephoneEvent,
     44      (int payload_type, int payload_frequency, int event, int duration_ms),
     45      (override));
     46  MOCK_METHOD(void, SetMuted, (bool muted), (override));
     47  MOCK_METHOD(Stats, GetStats, (), (const, override));
     48  MOCK_METHOD(Stats, GetStats, (bool has_remote_tracks), (const, override));
     49 };
     50 }  // namespace test
     51 }  // namespace webrtc
     52 
     53 #endif  // CALL_TEST_MOCK_AUDIO_SEND_STREAM_H_