mock_peer_connection_factory_interface.h (2740B)
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_PEER_CONNECTION_FACTORY_INTERFACE_H_ 12 #define API_TEST_MOCK_PEER_CONNECTION_FACTORY_INTERFACE_H_ 13 14 #include <cstdint> 15 #include <cstdio> 16 #include <string> 17 18 #include "absl/strings/string_view.h" 19 #include "api/audio_options.h" 20 #include "api/media_stream_interface.h" 21 #include "api/media_types.h" 22 #include "api/peer_connection_interface.h" 23 #include "api/rtc_error.h" 24 #include "api/rtp_parameters.h" 25 #include "api/scoped_refptr.h" 26 #include "rtc_base/ref_counted_object.h" 27 #include "test/gmock.h" 28 29 namespace webrtc { 30 31 class MockPeerConnectionFactoryInterface 32 : public RefCountedObject<PeerConnectionFactoryInterface> { 33 public: 34 static scoped_refptr<MockPeerConnectionFactoryInterface> Create() { 35 return scoped_refptr<MockPeerConnectionFactoryInterface>( 36 new MockPeerConnectionFactoryInterface()); 37 } 38 39 MOCK_METHOD(void, SetOptions, (const Options&), (override)); 40 MOCK_METHOD(RTCErrorOr<scoped_refptr<PeerConnectionInterface>>, 41 CreatePeerConnectionOrError, 42 (const PeerConnectionInterface::RTCConfiguration&, 43 PeerConnectionDependencies), 44 (override)); 45 MOCK_METHOD(RtpCapabilities, 46 GetRtpSenderCapabilities, 47 (MediaType), 48 (const, override)); 49 MOCK_METHOD(RtpCapabilities, 50 GetRtpReceiverCapabilities, 51 (MediaType), 52 (const, override)); 53 MOCK_METHOD(scoped_refptr<MediaStreamInterface>, 54 CreateLocalMediaStream, 55 (const std::string&), 56 (override)); 57 MOCK_METHOD(scoped_refptr<AudioSourceInterface>, 58 CreateAudioSource, 59 (const AudioOptions&), 60 (override)); 61 MOCK_METHOD(scoped_refptr<VideoTrackInterface>, 62 CreateVideoTrack, 63 (scoped_refptr<VideoTrackSourceInterface>, absl::string_view), 64 (override)); 65 MOCK_METHOD(scoped_refptr<AudioTrackInterface>, 66 CreateAudioTrack, 67 (const std::string&, AudioSourceInterface*), 68 (override)); 69 MOCK_METHOD(bool, StartAecDump, (FILE*, int64_t), (override)); 70 MOCK_METHOD(void, StopAecDump, (), (override)); 71 72 protected: 73 MockPeerConnectionFactoryInterface() = default; 74 }; 75 76 } // namespace webrtc 77 78 #endif // API_TEST_MOCK_PEER_CONNECTION_FACTORY_INTERFACE_H_