Steve Anton | 43ef5d9 | 2020-11-05 14:37:22 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2020 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 API_TEST_MOCK_RTP_TRANSCEIVER_H_ |
| 12 | #define API_TEST_MOCK_RTP_TRANSCEIVER_H_ |
| 13 | |
| 14 | #include <string> |
| 15 | #include <vector> |
| 16 | |
| 17 | #include "api/rtp_transceiver_interface.h" |
| 18 | #include "test/gmock.h" |
| 19 | |
| 20 | namespace webrtc { |
| 21 | |
Tomas Gunnarsson | 493718e | 2022-03-18 17:20:15 +0100 | [diff] [blame] | 22 | class MockRtpTransceiver : public RtpTransceiverInterface { |
Steve Anton | 43ef5d9 | 2020-11-05 14:37:22 -0800 | [diff] [blame] | 23 | public: |
Tomas Gunnarsson | 493718e | 2022-03-18 17:20:15 +0100 | [diff] [blame] | 24 | MockRtpTransceiver() = default; |
| 25 | |
Steve Anton | 43ef5d9 | 2020-11-05 14:37:22 -0800 | [diff] [blame] | 26 | static rtc::scoped_refptr<MockRtpTransceiver> Create() { |
Tomas Gunnarsson | 493718e | 2022-03-18 17:20:15 +0100 | [diff] [blame] | 27 | return rtc::make_ref_counted<MockRtpTransceiver>(); |
Steve Anton | 43ef5d9 | 2020-11-05 14:37:22 -0800 | [diff] [blame] | 28 | } |
| 29 | |
| 30 | MOCK_METHOD(cricket::MediaType, media_type, (), (const, override)); |
| 31 | MOCK_METHOD(absl::optional<std::string>, mid, (), (const, override)); |
| 32 | MOCK_METHOD(rtc::scoped_refptr<RtpSenderInterface>, |
| 33 | sender, |
| 34 | (), |
| 35 | (const, override)); |
| 36 | MOCK_METHOD(rtc::scoped_refptr<RtpReceiverInterface>, |
| 37 | receiver, |
| 38 | (), |
| 39 | (const, override)); |
| 40 | MOCK_METHOD(bool, stopped, (), (const, override)); |
| 41 | MOCK_METHOD(bool, stopping, (), (const, override)); |
| 42 | MOCK_METHOD(RtpTransceiverDirection, direction, (), (const, override)); |
| 43 | MOCK_METHOD(void, |
| 44 | SetDirection, |
| 45 | (RtpTransceiverDirection new_direction), |
| 46 | (override)); |
| 47 | MOCK_METHOD(RTCError, |
| 48 | SetDirectionWithError, |
| 49 | (RtpTransceiverDirection new_direction), |
| 50 | (override)); |
| 51 | MOCK_METHOD(absl::optional<RtpTransceiverDirection>, |
| 52 | current_direction, |
| 53 | (), |
| 54 | (const, override)); |
| 55 | MOCK_METHOD(absl::optional<RtpTransceiverDirection>, |
| 56 | fired_direction, |
| 57 | (), |
| 58 | (const, override)); |
| 59 | MOCK_METHOD(RTCError, StopStandard, (), (override)); |
| 60 | MOCK_METHOD(void, StopInternal, (), (override)); |
| 61 | MOCK_METHOD(void, Stop, (), (override)); |
| 62 | MOCK_METHOD(RTCError, |
| 63 | SetCodecPreferences, |
| 64 | (rtc::ArrayView<RtpCodecCapability> codecs), |
| 65 | (override)); |
| 66 | MOCK_METHOD(std::vector<RtpCodecCapability>, |
| 67 | codec_preferences, |
| 68 | (), |
| 69 | (const, override)); |
| 70 | MOCK_METHOD(std::vector<RtpHeaderExtensionCapability>, |
| 71 | HeaderExtensionsToOffer, |
| 72 | (), |
| 73 | (const, override)); |
Harald Alvestrand | 4f19950 | 2022-01-17 21:20:49 +0000 | [diff] [blame] | 74 | MOCK_METHOD(std::vector<RtpHeaderExtensionCapability>, |
| 75 | HeaderExtensionsNegotiated, |
| 76 | (), |
| 77 | (const, override)); |
Steve Anton | 43ef5d9 | 2020-11-05 14:37:22 -0800 | [diff] [blame] | 78 | MOCK_METHOD(webrtc::RTCError, |
| 79 | SetOfferedRtpHeaderExtensions, |
| 80 | (rtc::ArrayView<const RtpHeaderExtensionCapability> |
| 81 | header_extensions_to_offer), |
| 82 | (override)); |
Steve Anton | 43ef5d9 | 2020-11-05 14:37:22 -0800 | [diff] [blame] | 83 | }; |
| 84 | |
| 85 | } // namespace webrtc |
| 86 | |
| 87 | #endif // API_TEST_MOCK_RTP_TRANSCEIVER_H_ |