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 <memory>
15 #include <string>
16 
17 #include "api/peer_connection_interface.h"
18 #include "test/gmock.h"
19 
20 namespace webrtc {
21 
22 class MockPeerConnectionFactoryInterface final
23     : public rtc::RefCountedObject<webrtc::PeerConnectionFactoryInterface> {
24  public:
Create()25   rtc::scoped_refptr<MockPeerConnectionFactoryInterface> Create() {
26     return new MockPeerConnectionFactoryInterface();
27   }
28 
29   MOCK_METHOD(void, SetOptions, (const Options&), (override));
30   MOCK_METHOD(rtc::scoped_refptr<PeerConnectionInterface>,
31               CreatePeerConnection,
32               (const PeerConnectionInterface::RTCConfiguration&,
33                PeerConnectionDependencies),
34               (override));
35   MOCK_METHOD(rtc::scoped_refptr<PeerConnectionInterface>,
36               CreatePeerConnection,
37               (const PeerConnectionInterface::RTCConfiguration&,
38                std::unique_ptr<cricket::PortAllocator>,
39                std::unique_ptr<rtc::RTCCertificateGeneratorInterface>,
40                PeerConnectionObserver*),
41               (override));
42   MOCK_METHOD(RtpCapabilities,
43               GetRtpSenderCapabilities,
44               (cricket::MediaType),
45               (const override));
46   MOCK_METHOD(RtpCapabilities,
47               GetRtpReceiverCapabilities,
48               (cricket::MediaType),
49               (const override));
50   MOCK_METHOD(rtc::scoped_refptr<MediaStreamInterface>,
51               CreateLocalMediaStream,
52               (const std::string&),
53               (override));
54   MOCK_METHOD(rtc::scoped_refptr<AudioSourceInterface>,
55               CreateAudioSource,
56               (const cricket::AudioOptions&),
57               (override));
58   MOCK_METHOD(rtc::scoped_refptr<VideoTrackInterface>,
59               CreateVideoTrack,
60               (const std::string&, VideoTrackSourceInterface*),
61               (override));
62   MOCK_METHOD(rtc::scoped_refptr<AudioTrackInterface>,
63               CreateAudioTrack,
64               (const std::string&, AudioSourceInterface*),
65               (override));
66   MOCK_METHOD(bool, StartAecDump, (FILE*, int64_t), (override));
67   MOCK_METHOD(void, StopAecDump, (), (override));
68 
69  protected:
70   MockPeerConnectionFactoryInterface() = default;
71 };
72 
73 }  // namespace webrtc
74 
75 #endif  // API_TEST_MOCK_PEER_CONNECTION_FACTORY_INTERFACE_H_
76