2020-11-05 14:37:22 -08:00
|
|
|
/*
|
|
|
|
|
* Copyright 2020 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_RTP_TRANSCEIVER_H_
|
|
|
|
|
#define API_TEST_MOCK_RTP_TRANSCEIVER_H_
|
|
|
|
|
|
2024-08-29 13:00:40 +00:00
|
|
|
#include <optional>
|
2020-11-05 14:37:22 -08:00
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
2024-08-13 05:43:47 -07:00
|
|
|
#include "api/array_view.h"
|
|
|
|
|
#include "api/make_ref_counted.h"
|
|
|
|
|
#include "api/media_types.h"
|
|
|
|
|
#include "api/rtc_error.h"
|
|
|
|
|
#include "api/rtp_parameters.h"
|
|
|
|
|
#include "api/rtp_receiver_interface.h"
|
|
|
|
|
#include "api/rtp_sender_interface.h"
|
|
|
|
|
#include "api/rtp_transceiver_direction.h"
|
2020-11-05 14:37:22 -08:00
|
|
|
#include "api/rtp_transceiver_interface.h"
|
2024-08-13 05:43:47 -07:00
|
|
|
#include "api/scoped_refptr.h"
|
2020-11-05 14:37:22 -08:00
|
|
|
#include "test/gmock.h"
|
|
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
2022-03-18 17:20:15 +01:00
|
|
|
class MockRtpTransceiver : public RtpTransceiverInterface {
|
2020-11-05 14:37:22 -08:00
|
|
|
public:
|
2022-11-10 13:28:42 +00:00
|
|
|
MockRtpTransceiver() = default;
|
|
|
|
|
|
2020-11-05 14:37:22 -08:00
|
|
|
static rtc::scoped_refptr<MockRtpTransceiver> Create() {
|
2022-03-18 17:20:15 +01:00
|
|
|
return rtc::make_ref_counted<MockRtpTransceiver>();
|
2020-11-05 14:37:22 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MOCK_METHOD(cricket::MediaType, media_type, (), (const, override));
|
2024-08-29 13:00:40 +00:00
|
|
|
MOCK_METHOD(std::optional<std::string>, mid, (), (const, override));
|
2020-11-05 14:37:22 -08:00
|
|
|
MOCK_METHOD(rtc::scoped_refptr<RtpSenderInterface>,
|
|
|
|
|
sender,
|
|
|
|
|
(),
|
|
|
|
|
(const, override));
|
|
|
|
|
MOCK_METHOD(rtc::scoped_refptr<RtpReceiverInterface>,
|
|
|
|
|
receiver,
|
|
|
|
|
(),
|
|
|
|
|
(const, override));
|
|
|
|
|
MOCK_METHOD(bool, stopped, (), (const, override));
|
|
|
|
|
MOCK_METHOD(bool, stopping, (), (const, override));
|
|
|
|
|
MOCK_METHOD(RtpTransceiverDirection, direction, (), (const, override));
|
|
|
|
|
MOCK_METHOD(void,
|
|
|
|
|
SetDirection,
|
|
|
|
|
(RtpTransceiverDirection new_direction),
|
|
|
|
|
(override));
|
|
|
|
|
MOCK_METHOD(RTCError,
|
|
|
|
|
SetDirectionWithError,
|
|
|
|
|
(RtpTransceiverDirection new_direction),
|
|
|
|
|
(override));
|
2024-08-29 13:00:40 +00:00
|
|
|
MOCK_METHOD(std::optional<RtpTransceiverDirection>,
|
2020-11-05 14:37:22 -08:00
|
|
|
current_direction,
|
|
|
|
|
(),
|
|
|
|
|
(const, override));
|
2024-08-29 13:00:40 +00:00
|
|
|
MOCK_METHOD(std::optional<RtpTransceiverDirection>,
|
2020-11-05 14:37:22 -08:00
|
|
|
fired_direction,
|
|
|
|
|
(),
|
|
|
|
|
(const, override));
|
|
|
|
|
MOCK_METHOD(RTCError, StopStandard, (), (override));
|
|
|
|
|
MOCK_METHOD(void, StopInternal, (), (override));
|
|
|
|
|
MOCK_METHOD(void, Stop, (), (override));
|
|
|
|
|
MOCK_METHOD(RTCError,
|
|
|
|
|
SetCodecPreferences,
|
|
|
|
|
(rtc::ArrayView<RtpCodecCapability> codecs),
|
|
|
|
|
(override));
|
|
|
|
|
MOCK_METHOD(std::vector<RtpCodecCapability>,
|
|
|
|
|
codec_preferences,
|
|
|
|
|
(),
|
|
|
|
|
(const, override));
|
|
|
|
|
MOCK_METHOD(std::vector<RtpHeaderExtensionCapability>,
|
2023-03-06 18:08:31 +01:00
|
|
|
GetHeaderExtensionsToNegotiate,
|
2020-11-05 14:37:22 -08:00
|
|
|
(),
|
|
|
|
|
(const, override));
|
2022-01-17 21:20:49 +00:00
|
|
|
MOCK_METHOD(std::vector<RtpHeaderExtensionCapability>,
|
2023-03-06 18:08:31 +01:00
|
|
|
GetNegotiatedHeaderExtensions,
|
2022-01-17 21:20:49 +00:00
|
|
|
(),
|
|
|
|
|
(const, override));
|
2023-03-06 18:08:31 +01:00
|
|
|
MOCK_METHOD(
|
|
|
|
|
webrtc::RTCError,
|
|
|
|
|
SetHeaderExtensionsToNegotiate,
|
|
|
|
|
(rtc::ArrayView<const RtpHeaderExtensionCapability> header_extensions),
|
|
|
|
|
(override));
|
2020-11-05 14:37:22 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace webrtc
|
|
|
|
|
|
|
|
|
|
#endif // API_TEST_MOCK_RTP_TRANSCEIVER_H_
|