diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /third_party/libwebrtc/modules/rtp_rtcp/mocks | |
parent | Initial commit. (diff) | |
download | firefox-esr-upstream.tar.xz firefox-esr-upstream.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/modules/rtp_rtcp/mocks')
4 files changed, 275 insertions, 0 deletions
diff --git a/third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_recovered_packet_receiver.h b/third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_recovered_packet_receiver.h new file mode 100644 index 0000000000..d308b2cfa8 --- /dev/null +++ b/third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_recovered_packet_receiver.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2016 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 MODULES_RTP_RTCP_MOCKS_MOCK_RECOVERED_PACKET_RECEIVER_H_ +#define MODULES_RTP_RTCP_MOCKS_MOCK_RECOVERED_PACKET_RECEIVER_H_ + +#include "modules/rtp_rtcp/include/flexfec_receiver.h" +#include "modules/rtp_rtcp/source/rtp_packet_received.h" +#include "test/gmock.h" + +namespace webrtc { + +class MockRecoveredPacketReceiver : public RecoveredPacketReceiver { + public: + MOCK_METHOD(void, + OnRecoveredPacket, + (const RtpPacketReceived& packet), + (override)); +}; + +} // namespace webrtc + +#endif // MODULES_RTP_RTCP_MOCKS_MOCK_RECOVERED_PACKET_RECEIVER_H_ diff --git a/third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_rtcp_bandwidth_observer.h b/third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_rtcp_bandwidth_observer.h new file mode 100644 index 0000000000..12f143ae8b --- /dev/null +++ b/third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_rtcp_bandwidth_observer.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2018 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 MODULES_RTP_RTCP_MOCKS_MOCK_RTCP_BANDWIDTH_OBSERVER_H_ +#define MODULES_RTP_RTCP_MOCKS_MOCK_RTCP_BANDWIDTH_OBSERVER_H_ + +#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h" +#include "test/gmock.h" + +namespace webrtc { + +class MockRtcpBandwidthObserver : public RtcpBandwidthObserver { + public: + MOCK_METHOD(void, OnReceivedEstimatedBitrate, (uint32_t), (override)); + MOCK_METHOD(void, + OnReceivedRtcpReceiverReport, + (const ReportBlockList&, int64_t, int64_t), + (override)); +}; +} // namespace webrtc +#endif // MODULES_RTP_RTCP_MOCKS_MOCK_RTCP_BANDWIDTH_OBSERVER_H_ diff --git a/third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_rtcp_rtt_stats.h b/third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_rtcp_rtt_stats.h new file mode 100644 index 0000000000..e9a7d52691 --- /dev/null +++ b/third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_rtcp_rtt_stats.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2016 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 MODULES_RTP_RTCP_MOCKS_MOCK_RTCP_RTT_STATS_H_ +#define MODULES_RTP_RTCP_MOCKS_MOCK_RTCP_RTT_STATS_H_ + +#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h" +#include "test/gmock.h" + +namespace webrtc { + +class MockRtcpRttStats : public RtcpRttStats { + public: + MOCK_METHOD(void, OnRttUpdate, (int64_t rtt), (override)); + MOCK_METHOD(int64_t, LastProcessedRtt, (), (const, override)); +}; +} // namespace webrtc +#endif // MODULES_RTP_RTCP_MOCKS_MOCK_RTCP_RTT_STATS_H_ diff --git a/third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h b/third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h new file mode 100644 index 0000000000..75c30742df --- /dev/null +++ b/third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2012 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 MODULES_RTP_RTCP_MOCKS_MOCK_RTP_RTCP_H_ +#define MODULES_RTP_RTCP_MOCKS_MOCK_RTP_RTCP_H_ + +#include <memory> +#include <set> +#include <string> +#include <utility> +#include <vector> + +#include "absl/strings/string_view.h" +#include "absl/types/optional.h" +#include "api/video/video_bitrate_allocation.h" +#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h" +#include "modules/rtp_rtcp/source/rtp_packet_to_send.h" +#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h" +#include "test/gmock.h" + +namespace webrtc { + +class MockRtpRtcpInterface : public RtpRtcpInterface { + public: + MOCK_METHOD(void, + IncomingRtcpPacket, + (const uint8_t* incoming_packet, size_t packet_length), + (override)); + MOCK_METHOD(void, SetRemoteSSRC, (uint32_t ssrc), (override)); + MOCK_METHOD(void, SetLocalSsrc, (uint32_t ssrc), (override)); + MOCK_METHOD(void, SetMaxRtpPacketSize, (size_t size), (override)); + MOCK_METHOD(size_t, MaxRtpPacketSize, (), (const, override)); + MOCK_METHOD(void, + RegisterSendPayloadFrequency, + (int payload_type, int frequency), + (override)); + MOCK_METHOD(int32_t, + DeRegisterSendPayload, + (int8_t payload_type), + (override)); + MOCK_METHOD(void, SetExtmapAllowMixed, (bool extmap_allow_mixed), (override)); + MOCK_METHOD(void, + RegisterRtpHeaderExtension, + (absl::string_view uri, int id), + (override)); + MOCK_METHOD(void, + DeregisterSendRtpHeaderExtension, + (absl::string_view uri), + (override)); + MOCK_METHOD(bool, SupportsPadding, (), (const, override)); + MOCK_METHOD(bool, SupportsRtxPayloadPadding, (), (const, override)); + MOCK_METHOD(uint32_t, StartTimestamp, (), (const, override)); + MOCK_METHOD(void, SetStartTimestamp, (uint32_t timestamp), (override)); + MOCK_METHOD(uint16_t, SequenceNumber, (), (const, override)); + MOCK_METHOD(void, SetSequenceNumber, (uint16_t seq), (override)); + MOCK_METHOD(void, SetRtpState, (const RtpState& rtp_state), (override)); + MOCK_METHOD(void, SetRtxState, (const RtpState& rtp_state), (override)); + MOCK_METHOD(void, SetNonSenderRttMeasurement, (bool enabled), (override)); + MOCK_METHOD(RtpState, GetRtpState, (), (const, override)); + MOCK_METHOD(RtpState, GetRtxState, (), (const, override)); + MOCK_METHOD(uint32_t, SSRC, (), (const, override)); + MOCK_METHOD(void, SetMid, (absl::string_view mid), (override)); + MOCK_METHOD(void, SetRtxSendStatus, (int modes), (override)); + MOCK_METHOD(int, RtxSendStatus, (), (const, override)); + MOCK_METHOD(absl::optional<uint32_t>, RtxSsrc, (), (const, override)); + MOCK_METHOD(void, SetRtxSendPayloadType, (int, int), (override)); + MOCK_METHOD(absl::optional<uint32_t>, FlexfecSsrc, (), (const, override)); + MOCK_METHOD(int32_t, SetSendingStatus, (bool sending), (override)); + MOCK_METHOD(bool, Sending, (), (const, override)); + MOCK_METHOD(void, SetSendingMediaStatus, (bool sending), (override)); + MOCK_METHOD(bool, SendingMedia, (), (const, override)); + MOCK_METHOD(bool, IsAudioConfigured, (), (const, override)); + MOCK_METHOD(void, SetAsPartOfAllocation, (bool), (override)); + MOCK_METHOD(RtpSendRates, GetSendRates, (), (const, override)); + MOCK_METHOD(bool, + OnSendingRtpFrame, + (uint32_t, int64_t, int, bool), + (override)); + MOCK_METHOD(bool, + TrySendPacket, + (RtpPacketToSend * packet, const PacedPacketInfo& pacing_info), + (override)); + MOCK_METHOD(void, + SetFecProtectionParams, + (const FecProtectionParams& delta_params, + const FecProtectionParams& key_params), + (override)); + MOCK_METHOD(std::vector<std::unique_ptr<RtpPacketToSend>>, + FetchFecPackets, + (), + (override)); + MOCK_METHOD(void, + OnAbortedRetransmissions, + (rtc::ArrayView<const uint16_t>), + (override)); + MOCK_METHOD(void, + OnPacketsAcknowledged, + (rtc::ArrayView<const uint16_t>), + (override)); + MOCK_METHOD(std::vector<std::unique_ptr<RtpPacketToSend>>, + GeneratePadding, + (size_t target_size_bytes), + (override)); + MOCK_METHOD(std::vector<RtpSequenceNumberMap::Info>, + GetSentRtpPacketInfos, + (rtc::ArrayView<const uint16_t> sequence_numbers), + (const, override)); + MOCK_METHOD(size_t, ExpectedPerPacketOverhead, (), (const, override)); + MOCK_METHOD(void, OnPacketSendingThreadSwitched, (), (override)); + MOCK_METHOD(RtcpMode, RTCP, (), (const, override)); + MOCK_METHOD(void, SetRTCPStatus, (RtcpMode method), (override)); + MOCK_METHOD(int32_t, SetCNAME, (absl::string_view cname), (override)); + MOCK_METHOD(int32_t, + RemoteNTP, + (uint32_t * received_ntp_secs, + uint32_t* received_ntp_frac, + uint32_t* rtcp_arrival_time_secs, + uint32_t* rtcp_arrival_time_frac, + uint32_t* rtcp_timestamp), + (const, override)); + MOCK_METHOD(int32_t, + RTT, + (uint32_t remote_ssrc, + int64_t* rtt, + int64_t* avg_rtt, + int64_t* min_rtt, + int64_t* max_rtt), + (const, override)); + MOCK_METHOD(int64_t, ExpectedRetransmissionTimeMs, (), (const, override)); + MOCK_METHOD(int32_t, SendRTCP, (RTCPPacketType packet_type), (override)); + MOCK_METHOD(void, + GetSendStreamDataCounters, + (StreamDataCounters*, StreamDataCounters*), + (const, override)); + MOCK_METHOD(std::vector<ReportBlockData>, + GetLatestReportBlockData, + (), + (const, override)); + MOCK_METHOD(absl::optional<SenderReportStats>, + GetSenderReportStats, + (), + (const, override)); + MOCK_METHOD(absl::optional<NonSenderRttStats>, + GetNonSenderRttStats, + (), + (const, override)); + MOCK_METHOD(void, + SetRemb, + (int64_t bitrate, std::vector<uint32_t> ssrcs), + (override)); + MOCK_METHOD(void, UnsetRemb, (), (override)); + MOCK_METHOD(int32_t, + SendNACK, + (const uint16_t* nack_list, uint16_t size), + (override)); + MOCK_METHOD(void, + SendNack, + (const std::vector<uint16_t>& sequence_numbers), + (override)); + MOCK_METHOD(void, + SetStorePacketsStatus, + (bool enable, uint16_t number_to_store), + (override)); + MOCK_METHOD(void, + SendCombinedRtcpPacket, + (std::vector<std::unique_ptr<rtcp::RtcpPacket>> rtcp_packets), + (override)); + MOCK_METHOD(int32_t, + SendLossNotification, + (uint16_t last_decoded_seq_num, + uint16_t last_received_seq_num, + bool decodability_flag, + bool buffering_allowed), + (override)); + MOCK_METHOD(void, + SetVideoBitrateAllocation, + (const VideoBitrateAllocation&), + (override)); + MOCK_METHOD(RTPSender*, RtpSender, (), (override)); + MOCK_METHOD(const RTPSender*, RtpSender, (), (const, override)); +}; + +} // namespace webrtc + +#endif // MODULES_RTP_RTCP_MOCKS_MOCK_RTP_RTCP_H_ |