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