Restructure RtcpTransceiver tests to use fake time instead of real time
to make tests faster and more determenistic. Bug: webrtc:8239 Change-Id: I18067251a1f1a349fda28bbfbb59bce333bfddca Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/201737 Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Per Kjellander <perkj@webrtc.org> Cr-Commit-Position: refs/heads/main@{#36938}
This commit is contained in:

committed by
WebRTC LUCI CQ

parent
f2c710852e
commit
fa6ec69232
@ -606,12 +606,14 @@ if (rtc_include_tests) {
|
|||||||
":rtp_rtcp_format",
|
":rtp_rtcp_format",
|
||||||
":rtp_rtcp_legacy",
|
":rtp_rtcp_legacy",
|
||||||
"../../api:array_view",
|
"../../api:array_view",
|
||||||
|
"../../api:create_time_controller",
|
||||||
"../../api:libjingle_peerconnection_api",
|
"../../api:libjingle_peerconnection_api",
|
||||||
"../../api:mock_frame_encryptor",
|
"../../api:mock_frame_encryptor",
|
||||||
"../../api:rtp_headers",
|
"../../api:rtp_headers",
|
||||||
"../../api:rtp_packet_info",
|
"../../api:rtp_packet_info",
|
||||||
"../../api:rtp_parameters",
|
"../../api:rtp_parameters",
|
||||||
"../../api:scoped_refptr",
|
"../../api:scoped_refptr",
|
||||||
|
"../../api:time_controller",
|
||||||
"../../api:transport_api",
|
"../../api:transport_api",
|
||||||
"../../api/rtc_event_log",
|
"../../api/rtc_event_log",
|
||||||
"../../api/transport:field_trial_based_config",
|
"../../api/transport:field_trial_based_config",
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
#include "rtc_base/event.h"
|
#include "rtc_base/event.h"
|
||||||
#include "rtc_base/task_utils/to_queued_task.h"
|
#include "rtc_base/task_utils/to_queued_task.h"
|
||||||
#include "rtc_base/time_utils.h"
|
#include "system_wrappers/include/clock.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
|
@ -44,6 +44,10 @@ bool RtcpTransceiverConfig::Validate() const {
|
|||||||
<< " more than " << IP_PACKET_SIZE << " is unsupported.";
|
<< " more than " << IP_PACKET_SIZE << " is unsupported.";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (clock == nullptr) {
|
||||||
|
RTC_LOG(LS_ERROR) << debug_id << "clock must be set";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (!outgoing_transport) {
|
if (!outgoing_transport) {
|
||||||
RTC_LOG(LS_ERROR) << debug_id << "outgoing transport must be set";
|
RTC_LOG(LS_ERROR) << debug_id << "outgoing transport must be set";
|
||||||
return false;
|
return false;
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
#include "rtc_base/numerics/divide_round.h"
|
#include "rtc_base/numerics/divide_round.h"
|
||||||
#include "rtc_base/task_utils/repeating_task.h"
|
#include "rtc_base/task_utils/repeating_task.h"
|
||||||
#include "rtc_base/task_utils/to_queued_task.h"
|
#include "rtc_base/task_utils/to_queued_task.h"
|
||||||
#include "rtc_base/time_utils.h"
|
#include "system_wrappers/include/clock.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace {
|
namespace {
|
||||||
@ -562,13 +562,15 @@ void RtcpTransceiverImpl::ReschedulePeriodicCompoundPackets() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RtcpTransceiverImpl::SchedulePeriodicCompoundPackets(TimeDelta delay) {
|
void RtcpTransceiverImpl::SchedulePeriodicCompoundPackets(TimeDelta delay) {
|
||||||
periodic_task_handle_ =
|
periodic_task_handle_ = RepeatingTaskHandle::DelayedStart(
|
||||||
RepeatingTaskHandle::DelayedStart(config_.task_queue, delay, [this] {
|
config_.task_queue, delay,
|
||||||
|
[this] {
|
||||||
RTC_DCHECK(config_.schedule_periodic_compound_packets);
|
RTC_DCHECK(config_.schedule_periodic_compound_packets);
|
||||||
RTC_DCHECK(ready_to_send_);
|
RTC_DCHECK(ready_to_send_);
|
||||||
SendPeriodicCompoundPacket();
|
SendPeriodicCompoundPacket();
|
||||||
return config_.report_period;
|
return config_.report_period;
|
||||||
});
|
},
|
||||||
|
TaskQueueBase::DelayPrecision::kLow, config_.clock);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<uint32_t> RtcpTransceiverImpl::FillReports(
|
std::vector<uint32_t> RtcpTransceiverImpl::FillReports(
|
||||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user