mock_audio_send_stream.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. #ifndef CALL_TEST_MOCK_AUDIO_SEND_STREAM_H_
  11. #define CALL_TEST_MOCK_AUDIO_SEND_STREAM_H_
  12. #include <memory>
  13. #include "call/audio_send_stream.h"
  14. #include "test/gmock.h"
  15. namespace webrtc {
  16. namespace test {
  17. class MockAudioSendStream : public AudioSendStream {
  18. public:
  19. MOCK_METHOD(const webrtc::AudioSendStream::Config&,
  20. GetConfig,
  21. (),
  22. (const, override));
  23. MOCK_METHOD(void, Reconfigure, (const Config& config), (override));
  24. MOCK_METHOD(void, Start, (), (override));
  25. MOCK_METHOD(void, Stop, (), (override));
  26. // GMock doesn't like move-only types, such as std::unique_ptr.
  27. void SendAudioData(std::unique_ptr<webrtc::AudioFrame> audio_frame) override {
  28. SendAudioDataForMock(audio_frame.get());
  29. }
  30. MOCK_METHOD(void, SendAudioDataForMock, (webrtc::AudioFrame*));
  31. MOCK_METHOD(
  32. bool,
  33. SendTelephoneEvent,
  34. (int payload_type, int payload_frequency, int event, int duration_ms),
  35. (override));
  36. MOCK_METHOD(void, SetMuted, (bool muted), (override));
  37. MOCK_METHOD(Stats, GetStats, (), (const, override));
  38. MOCK_METHOD(Stats, GetStats, (bool has_remote_tracks), (const, override));
  39. };
  40. } // namespace test
  41. } // namespace webrtc
  42. #endif // CALL_TEST_MOCK_AUDIO_SEND_STREAM_H_