Amit Hilbuch | dd9390c | 2018-11-13 16:26:05 -0800 | [diff] [blame] | 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 | |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 11 | #ifndef PC_TEST_MOCK_CHANNEL_INTERFACE_H_ |
| 12 | #define PC_TEST_MOCK_CHANNEL_INTERFACE_H_ |
Amit Hilbuch | dd9390c | 2018-11-13 16:26:05 -0800 | [diff] [blame] | 13 | |
| 14 | #include <string> |
Amit Hilbuch | bcd39d4 | 2019-01-25 17:13:56 -0800 | [diff] [blame] | 15 | #include <vector> |
Amit Hilbuch | dd9390c | 2018-11-13 16:26:05 -0800 | [diff] [blame] | 16 | |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 17 | #include "pc/channel_interface.h" |
Amit Hilbuch | dd9390c | 2018-11-13 16:26:05 -0800 | [diff] [blame] | 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*)); |
Amit Hilbuch | bcd39d4 | 2019-01-25 17:13:56 -0800 | [diff] [blame] | 43 | MOCK_CONST_METHOD0(local_streams, const std::vector<StreamParams>&()); |
| 44 | MOCK_CONST_METHOD0(remote_streams, const std::vector<StreamParams>&()); |
Amit Hilbuch | dd9390c | 2018-11-13 16:26:05 -0800 | [diff] [blame] | 45 | MOCK_METHOD1(SetRtpTransport, bool(webrtc::RtpTransportInternal*)); |
| 46 | }; |
| 47 | |
| 48 | } // namespace cricket |
| 49 | |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 50 | #endif // PC_TEST_MOCK_CHANNEL_INTERFACE_H_ |