blob: a0a08c477281a0595caa0c3ef33094a6faf7b92d [file] [log] [blame]
Steve Anton43ef5d92020-11-05 14:37:22 -08001/*
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 <string>
15#include <vector>
16
17#include "api/rtp_transceiver_interface.h"
18#include "test/gmock.h"
19
20namespace webrtc {
21
22class MockRtpTransceiver final
23 : public rtc::RefCountedObject<RtpTransceiverInterface> {
24 public:
25 static rtc::scoped_refptr<MockRtpTransceiver> Create() {
26 return new MockRtpTransceiver();
27 }
28
29 MOCK_METHOD(cricket::MediaType, media_type, (), (const, override));
30 MOCK_METHOD(absl::optional<std::string>, mid, (), (const, override));
31 MOCK_METHOD(rtc::scoped_refptr<RtpSenderInterface>,
32 sender,
33 (),
34 (const, override));
35 MOCK_METHOD(rtc::scoped_refptr<RtpReceiverInterface>,
36 receiver,
37 (),
38 (const, override));
39 MOCK_METHOD(bool, stopped, (), (const, override));
40 MOCK_METHOD(bool, stopping, (), (const, override));
41 MOCK_METHOD(RtpTransceiverDirection, direction, (), (const, override));
42 MOCK_METHOD(void,
43 SetDirection,
44 (RtpTransceiverDirection new_direction),
45 (override));
46 MOCK_METHOD(RTCError,
47 SetDirectionWithError,
48 (RtpTransceiverDirection new_direction),
49 (override));
50 MOCK_METHOD(absl::optional<RtpTransceiverDirection>,
51 current_direction,
52 (),
53 (const, override));
54 MOCK_METHOD(absl::optional<RtpTransceiverDirection>,
55 fired_direction,
56 (),
57 (const, override));
58 MOCK_METHOD(RTCError, StopStandard, (), (override));
59 MOCK_METHOD(void, StopInternal, (), (override));
60 MOCK_METHOD(void, Stop, (), (override));
61 MOCK_METHOD(RTCError,
62 SetCodecPreferences,
63 (rtc::ArrayView<RtpCodecCapability> codecs),
64 (override));
65 MOCK_METHOD(std::vector<RtpCodecCapability>,
66 codec_preferences,
67 (),
68 (const, override));
69 MOCK_METHOD(std::vector<RtpHeaderExtensionCapability>,
70 HeaderExtensionsToOffer,
71 (),
72 (const, override));
73 MOCK_METHOD(webrtc::RTCError,
74 SetOfferedRtpHeaderExtensions,
75 (rtc::ArrayView<const RtpHeaderExtensionCapability>
76 header_extensions_to_offer),
77 (override));
78
79 private:
80 MockRtpTransceiver() = default;
81};
82
83} // namespace webrtc
84
85#endif // API_TEST_MOCK_RTP_TRANSCEIVER_H_