mock_channel_interface.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright 2018 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 PC_TEST_MOCK_CHANNEL_INTERFACE_H_
  11. #define PC_TEST_MOCK_CHANNEL_INTERFACE_H_
  12. #include <string>
  13. #include <vector>
  14. #include "pc/channel_interface.h"
  15. #include "test/gmock.h"
  16. namespace cricket {
  17. // Mock class for BaseChannel.
  18. // Use this class in unit tests to avoid dependecy on a specific
  19. // implementation of BaseChannel.
  20. class MockChannelInterface : public cricket::ChannelInterface {
  21. public:
  22. MOCK_METHOD(cricket::MediaType, media_type, (), (const, override));
  23. MOCK_METHOD(MediaChannel*, media_channel, (), (const, override));
  24. MOCK_METHOD(const std::string&, transport_name, (), (const, override));
  25. MOCK_METHOD(const std::string&, content_name, (), (const, override));
  26. MOCK_METHOD(bool, enabled, (), (const, override));
  27. MOCK_METHOD(bool, Enable, (bool), (override));
  28. MOCK_METHOD(sigslot::signal1<ChannelInterface*>&,
  29. SignalFirstPacketReceived,
  30. (),
  31. (override));
  32. MOCK_METHOD(bool,
  33. SetLocalContent,
  34. (const cricket::MediaContentDescription*,
  35. webrtc::SdpType,
  36. std::string*),
  37. (override));
  38. MOCK_METHOD(bool,
  39. SetRemoteContent,
  40. (const cricket::MediaContentDescription*,
  41. webrtc::SdpType,
  42. std::string*),
  43. (override));
  44. MOCK_METHOD(bool, SetPayloadTypeDemuxingEnabled, (bool), (override));
  45. MOCK_METHOD(const std::vector<StreamParams>&,
  46. local_streams,
  47. (),
  48. (const, override));
  49. MOCK_METHOD(const std::vector<StreamParams>&,
  50. remote_streams,
  51. (),
  52. (const, override));
  53. MOCK_METHOD(bool,
  54. SetRtpTransport,
  55. (webrtc::RtpTransportInternal*),
  56. (override));
  57. };
  58. } // namespace cricket
  59. #endif // PC_TEST_MOCK_CHANNEL_INTERFACE_H_