blob: 1d21bce5eb6ad94f6bd7d2c3aa721182e386ef46 [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
Tomas Gunnarsson493718e2022-03-18 17:20:15 +010022class MockRtpTransceiver : public RtpTransceiverInterface {
Steve Anton43ef5d92020-11-05 14:37:22 -080023 public:
Tomas Gunnarsson493718e2022-03-18 17:20:15 +010024 MockRtpTransceiver() = default;
25
Steve Anton43ef5d92020-11-05 14:37:22 -080026 static rtc::scoped_refptr<MockRtpTransceiver> Create() {
Tomas Gunnarsson493718e2022-03-18 17:20:15 +010027 return rtc::make_ref_counted<MockRtpTransceiver>();
Steve Anton43ef5d92020-11-05 14:37:22 -080028 }
29
30 MOCK_METHOD(cricket::MediaType, media_type, (), (const, override));
31 MOCK_METHOD(absl::optional<std::string>, mid, (), (const, override));
32 MOCK_METHOD(rtc::scoped_refptr<RtpSenderInterface>,
33 sender,
34 (),
35 (const, override));
36 MOCK_METHOD(rtc::scoped_refptr<RtpReceiverInterface>,
37 receiver,
38 (),
39 (const, override));
40 MOCK_METHOD(bool, stopped, (), (const, override));
41 MOCK_METHOD(bool, stopping, (), (const, override));
42 MOCK_METHOD(RtpTransceiverDirection, direction, (), (const, override));
43 MOCK_METHOD(void,
44 SetDirection,
45 (RtpTransceiverDirection new_direction),
46 (override));
47 MOCK_METHOD(RTCError,
48 SetDirectionWithError,
49 (RtpTransceiverDirection new_direction),
50 (override));
51 MOCK_METHOD(absl::optional<RtpTransceiverDirection>,
52 current_direction,
53 (),
54 (const, override));
55 MOCK_METHOD(absl::optional<RtpTransceiverDirection>,
56 fired_direction,
57 (),
58 (const, override));
59 MOCK_METHOD(RTCError, StopStandard, (), (override));
60 MOCK_METHOD(void, StopInternal, (), (override));
61 MOCK_METHOD(void, Stop, (), (override));
62 MOCK_METHOD(RTCError,
63 SetCodecPreferences,
64 (rtc::ArrayView<RtpCodecCapability> codecs),
65 (override));
66 MOCK_METHOD(std::vector<RtpCodecCapability>,
67 codec_preferences,
68 (),
69 (const, override));
70 MOCK_METHOD(std::vector<RtpHeaderExtensionCapability>,
71 HeaderExtensionsToOffer,
72 (),
73 (const, override));
Harald Alvestrand4f199502022-01-17 21:20:49 +000074 MOCK_METHOD(std::vector<RtpHeaderExtensionCapability>,
75 HeaderExtensionsNegotiated,
76 (),
77 (const, override));
Steve Anton43ef5d92020-11-05 14:37:22 -080078 MOCK_METHOD(webrtc::RTCError,
79 SetOfferedRtpHeaderExtensions,
80 (rtc::ArrayView<const RtpHeaderExtensionCapability>
81 header_extensions_to_offer),
82 (override));
Steve Anton43ef5d92020-11-05 14:37:22 -080083};
84
85} // namespace webrtc
86
87#endif // API_TEST_MOCK_RTP_TRANSCEIVER_H_