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(bool, SetPayloadTypeDemuxingEnabled, (bool), (override));
50   MOCK_METHOD(const std::vector<StreamParams>&,
51               local_streams,
52               (),
53               (const, override));
54   MOCK_METHOD(const std::vector<StreamParams>&,
55               remote_streams,
56               (),
57               (const, override));
58   MOCK_METHOD(bool,
59               SetRtpTransport,
60               (webrtc::RtpTransportInternal*),
61               (override));
62 };
63 
64 }  // namespace cricket
65 
66 #endif  // PC_TEST_MOCK_CHANNEL_INTERFACE_H_
67