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