mock_rtp_transceiver.h (3204B)
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 <optional> 15 #include <string> 16 #include <vector> 17 18 #include "api/array_view.h" 19 #include "api/make_ref_counted.h" 20 #include "api/media_types.h" 21 #include "api/rtc_error.h" 22 #include "api/rtp_parameters.h" 23 #include "api/rtp_receiver_interface.h" 24 #include "api/rtp_sender_interface.h" 25 #include "api/rtp_transceiver_direction.h" 26 #include "api/rtp_transceiver_interface.h" 27 #include "api/scoped_refptr.h" 28 #include "test/gmock.h" 29 30 namespace webrtc { 31 32 class MockRtpTransceiver : public RtpTransceiverInterface { 33 public: 34 MockRtpTransceiver() = default; 35 36 static scoped_refptr<MockRtpTransceiver> Create() { 37 return make_ref_counted<MockRtpTransceiver>(); 38 } 39 40 MOCK_METHOD(MediaType, media_type, (), (const, override)); 41 MOCK_METHOD(std::optional<std::string>, mid, (), (const, override)); 42 MOCK_METHOD(scoped_refptr<RtpSenderInterface>, sender, (), (const, override)); 43 MOCK_METHOD(scoped_refptr<RtpReceiverInterface>, 44 receiver, 45 (), 46 (const, override)); 47 MOCK_METHOD(bool, stopped, (), (const, override)); 48 MOCK_METHOD(bool, stopping, (), (const, override)); 49 MOCK_METHOD(RtpTransceiverDirection, direction, (), (const, override)); 50 MOCK_METHOD(void, 51 SetDirection, 52 (RtpTransceiverDirection new_direction), 53 (override)); 54 MOCK_METHOD(RTCError, 55 SetDirectionWithError, 56 (RtpTransceiverDirection new_direction), 57 (override)); 58 MOCK_METHOD(std::optional<RtpTransceiverDirection>, 59 current_direction, 60 (), 61 (const, override)); 62 MOCK_METHOD(std::optional<RtpTransceiverDirection>, 63 fired_direction, 64 (), 65 (const, override)); 66 MOCK_METHOD(RTCError, StopStandard, (), (override)); 67 MOCK_METHOD(void, StopInternal, (), (override)); 68 MOCK_METHOD(void, Stop, (), (override)); 69 MOCK_METHOD(RTCError, 70 SetCodecPreferences, 71 (ArrayView<RtpCodecCapability> codecs), 72 (override)); 73 MOCK_METHOD(std::vector<RtpCodecCapability>, 74 codec_preferences, 75 (), 76 (const, override)); 77 MOCK_METHOD(std::vector<RtpHeaderExtensionCapability>, 78 GetHeaderExtensionsToNegotiate, 79 (), 80 (const, override)); 81 MOCK_METHOD(std::vector<RtpHeaderExtensionCapability>, 82 GetNegotiatedHeaderExtensions, 83 (), 84 (const, override)); 85 MOCK_METHOD(RTCError, 86 SetHeaderExtensionsToNegotiate, 87 (ArrayView<const RtpHeaderExtensionCapability> header_extensions), 88 (override)); 89 }; 90 91 } // namespace webrtc 92 93 #endif // API_TEST_MOCK_RTP_TRANSCEIVER_H_