1 /* 2 * Copyright 2016 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_RTPSENDER_H_ 12 #define API_TEST_MOCK_RTPSENDER_H_ 13 14 #include <memory> 15 #include <string> 16 #include <vector> 17 18 #include "api/rtp_sender_interface.h" 19 #include "test/gmock.h" 20 21 namespace webrtc { 22 23 class MockRtpSender : public RtpSenderInterface { 24 public: Create()25 static rtc::scoped_refptr<MockRtpSender> Create() { 26 return rtc::make_ref_counted<MockRtpSender>(); 27 } 28 29 MOCK_METHOD(bool, SetTrack, (MediaStreamTrackInterface*), (override)); 30 MOCK_METHOD(rtc::scoped_refptr<MediaStreamTrackInterface>, 31 track, 32 (), 33 (const, override)); 34 MOCK_METHOD(rtc::scoped_refptr<DtlsTransportInterface>, 35 dtls_transport, 36 (), 37 (const override)); 38 MOCK_METHOD(uint32_t, ssrc, (), (const, override)); 39 MOCK_METHOD(cricket::MediaType, media_type, (), (const, override)); 40 MOCK_METHOD(std::string, id, (), (const, override)); 41 MOCK_METHOD(std::vector<std::string>, stream_ids, (), (const, override)); 42 MOCK_METHOD(void, SetStreams, (const std::vector<std::string>&), (override)); 43 MOCK_METHOD(std::vector<RtpEncodingParameters>, 44 init_send_encodings, 45 (), 46 (const, override)); 47 MOCK_METHOD(RtpParameters, GetParameters, (), (const, override)); 48 MOCK_METHOD(RTCError, SetParameters, (const RtpParameters&), (override)); 49 MOCK_METHOD(void, 50 SetParametersAsync, 51 (const RtpParameters&, SetParametersCallback), 52 (override)); 53 MOCK_METHOD(rtc::scoped_refptr<DtmfSenderInterface>, 54 GetDtmfSender, 55 (), 56 (const, override)); 57 MOCK_METHOD(void, 58 SetFrameEncryptor, 59 (rtc::scoped_refptr<FrameEncryptorInterface>), 60 (override)); 61 MOCK_METHOD(rtc::scoped_refptr<FrameEncryptorInterface>, 62 GetFrameEncryptor, 63 (), 64 (const, override)); 65 MOCK_METHOD(void, 66 SetEncoderToPacketizerFrameTransformer, 67 (rtc::scoped_refptr<FrameTransformerInterface>), 68 (override)); 69 MOCK_METHOD(void, 70 SetEncoderSelector, 71 (std::unique_ptr<VideoEncoderFactory::EncoderSelectorInterface>), 72 (override)); 73 }; 74 75 static_assert(!std::is_abstract_v<rtc::RefCountedObject<MockRtpSender>>, ""); 76 } // namespace webrtc 77 78 #endif // API_TEST_MOCK_RTPSENDER_H_ 79