You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.8 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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_CONST_METHOD0(media_type, cricket::MediaType());
  23. MOCK_CONST_METHOD0(media_channel, MediaChannel*());
  24. MOCK_CONST_METHOD0(transport_name, const std::string&());
  25. MOCK_CONST_METHOD0(content_name, const std::string&());
  26. MOCK_CONST_METHOD0(enabled, bool());
  27. MOCK_METHOD1(Enable, bool(bool));
  28. MOCK_METHOD0(SignalFirstPacketReceived,
  29. sigslot::signal1<ChannelInterface*>&());
  30. MOCK_METHOD3(SetLocalContent,
  31. bool(const cricket::MediaContentDescription*,
  32. webrtc::SdpType,
  33. std::string*));
  34. MOCK_METHOD3(SetRemoteContent,
  35. bool(const cricket::MediaContentDescription*,
  36. webrtc::SdpType,
  37. std::string*));
  38. MOCK_CONST_METHOD0(local_streams, const std::vector<StreamParams>&());
  39. MOCK_CONST_METHOD0(remote_streams, const std::vector<StreamParams>&());
  40. MOCK_METHOD1(SetRtpTransport, bool(webrtc::RtpTransportInternal*));
  41. };
  42. } // namespace cricket
  43. #endif // PC_TEST_MOCK_CHANNEL_INTERFACE_H_