/* * Copyright 2016 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef API_TEST_MOCK_PEERCONNECTIONINTERFACE_H_ #define API_TEST_MOCK_PEERCONNECTIONINTERFACE_H_ #include #include #include #include #include #include "api/peer_connection_interface.h" #include "api/sctp_transport_interface.h" #include "test/gmock.h" namespace webrtc { class MockPeerConnectionInterface : public rtc::RefCountedObject { public: // PeerConnectionInterface MOCK_METHOD(rtc::scoped_refptr, local_streams, (), (override)); MOCK_METHOD(rtc::scoped_refptr, remote_streams, (), (override)); MOCK_METHOD(bool, AddStream, (MediaStreamInterface*), (override)); MOCK_METHOD(void, RemoveStream, (MediaStreamInterface*), (override)); MOCK_METHOD(RTCErrorOr>, AddTrack, (rtc::scoped_refptr, const std::vector&), (override)); MOCK_METHOD(bool, RemoveTrack, (RtpSenderInterface*), (override)); MOCK_METHOD(RTCError, RemoveTrackNew, (rtc::scoped_refptr), (override)); MOCK_METHOD(RTCErrorOr>, AddTransceiver, (rtc::scoped_refptr), (override)); MOCK_METHOD(RTCErrorOr>, AddTransceiver, (rtc::scoped_refptr, const RtpTransceiverInit&), (override)); MOCK_METHOD(RTCErrorOr>, AddTransceiver, (cricket::MediaType), (override)); MOCK_METHOD(RTCErrorOr>, AddTransceiver, (cricket::MediaType, const RtpTransceiverInit&), (override)); MOCK_METHOD(rtc::scoped_refptr, CreateSender, (const std::string&, const std::string&), (override)); MOCK_METHOD(std::vector>, GetSenders, (), (const override)); MOCK_METHOD(std::vector>, GetReceivers, (), (const override)); MOCK_METHOD(std::vector>, GetTransceivers, (), (const override)); MOCK_METHOD(bool, GetStats, (StatsObserver*, MediaStreamTrackInterface*, StatsOutputLevel), (override)); MOCK_METHOD(void, GetStats, (RTCStatsCollectorCallback*), (override)); MOCK_METHOD(void, GetStats, (rtc::scoped_refptr, rtc::scoped_refptr), (override)); MOCK_METHOD(void, GetStats, (rtc::scoped_refptr, rtc::scoped_refptr), (override)); MOCK_METHOD(void, ClearStatsCache, (), (override)); MOCK_METHOD(rtc::scoped_refptr, GetSctpTransport, (), (const override)); MOCK_METHOD(rtc::scoped_refptr, CreateDataChannel, (const std::string&, const DataChannelInit*), (override)); MOCK_METHOD(const SessionDescriptionInterface*, local_description, (), (const override)); MOCK_METHOD(const SessionDescriptionInterface*, remote_description, (), (const override)); MOCK_METHOD(const SessionDescriptionInterface*, current_local_description, (), (const override)); MOCK_METHOD(const SessionDescriptionInterface*, current_remote_description, (), (const override)); MOCK_METHOD(const SessionDescriptionInterface*, pending_local_description, (), (const override)); MOCK_METHOD(const SessionDescriptionInterface*, pending_remote_description, (), (const override)); MOCK_METHOD(void, RestartIce, (), (override)); MOCK_METHOD(void, CreateOffer, (CreateSessionDescriptionObserver*, const RTCOfferAnswerOptions&), (override)); MOCK_METHOD(void, CreateAnswer, (CreateSessionDescriptionObserver*, const RTCOfferAnswerOptions&), (override)); MOCK_METHOD(void, SetLocalDescription, (SetSessionDescriptionObserver*, SessionDescriptionInterface*), (override)); MOCK_METHOD(void, SetRemoteDescription, (SetSessionDescriptionObserver*, SessionDescriptionInterface*), (override)); MOCK_METHOD(void, SetRemoteDescription, (std::unique_ptr, rtc::scoped_refptr), (override)); MOCK_METHOD(PeerConnectionInterface::RTCConfiguration, GetConfiguration, (), (override)); MOCK_METHOD(RTCError, SetConfiguration, (const PeerConnectionInterface::RTCConfiguration&), (override)); MOCK_METHOD(bool, AddIceCandidate, (const IceCandidateInterface*), (override)); MOCK_METHOD(bool, RemoveIceCandidates, (const std::vector&), (override)); MOCK_METHOD(RTCError, SetBitrate, (const BitrateSettings&), (override)); MOCK_METHOD(void, SetAudioPlayout, (bool), (override)); MOCK_METHOD(void, SetAudioRecording, (bool), (override)); MOCK_METHOD(rtc::scoped_refptr, LookupDtlsTransportByMid, (const std::string&), (override)); MOCK_METHOD(SignalingState, signaling_state, (), (override)); MOCK_METHOD(IceConnectionState, ice_connection_state, (), (override)); MOCK_METHOD(IceConnectionState, standardized_ice_connection_state, (), (override)); MOCK_METHOD(PeerConnectionState, peer_connection_state, (), (override)); MOCK_METHOD(IceGatheringState, ice_gathering_state, (), (override)); MOCK_METHOD(absl::optional, can_trickle_ice_candidates, (), (override)); MOCK_METHOD(bool, StartRtcEventLog, (std::unique_ptr, int64_t), (override)); MOCK_METHOD(bool, StartRtcEventLog, (std::unique_ptr), (override)); MOCK_METHOD(void, StopRtcEventLog, (), (override)); MOCK_METHOD(void, Close, (), (override)); }; static_assert(!std::is_abstract::value, ""); } // namespace webrtc #endif // API_TEST_MOCK_PEERCONNECTIONINTERFACE_H_