diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /third_party/libwebrtc/video/end_to_end_tests | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/video/end_to_end_tests')
3 files changed, 12 insertions, 16 deletions
diff --git a/third_party/libwebrtc/video/end_to_end_tests/multi_stream_tester.cc b/third_party/libwebrtc/video/end_to_end_tests/multi_stream_tester.cc index 1eb388cc76..759b75ccf9 100644 --- a/third_party/libwebrtc/video/end_to_end_tests/multi_stream_tester.cc +++ b/third_party/libwebrtc/video/end_to_end_tests/multi_stream_tester.cc @@ -14,8 +14,8 @@ #include <utility> #include <vector> -#include "api/rtc_event_log/rtc_event_log.h" -#include "api/task_queue/default_task_queue_factory.h" +#include "api/environment/environment.h" +#include "api/environment/environment_factory.h" #include "api/task_queue/task_queue_base.h" #include "api/test/create_frame_generator.h" #include "api/test/simulated_network.h" @@ -42,17 +42,13 @@ MultiStreamTester::MultiStreamTester() { MultiStreamTester::~MultiStreamTester() = default; void MultiStreamTester::RunTest() { - webrtc::RtcEventLogNull event_log; - auto task_queue_factory = CreateDefaultTaskQueueFactory(); + Environment env = CreateEnvironment(); // Use high prioirity since this task_queue used for fake network delivering // at correct time. Those test tasks should be prefered over code under test // to make test more stable. - auto task_queue = task_queue_factory->CreateTaskQueue( + auto task_queue = env.task_queue_factory().CreateTaskQueue( "TaskQueue", TaskQueueFactory::Priority::HIGH); - CallConfig config(&event_log); - test::ScopedKeyValueConfig field_trials; - config.trials = &field_trials; - config.task_queue_factory = task_queue_factory.get(); + CallConfig config(env); std::unique_ptr<Call> sender_call; std::unique_ptr<Call> receiver_call; std::unique_ptr<test::DirectTransport> sender_transport; @@ -115,10 +111,10 @@ void MultiStreamTester::RunTest() { receive_streams[i]->Start(); auto* frame_generator = new test::FrameGeneratorCapturer( - Clock::GetRealTimeClock(), + &env.clock(), test::CreateSquareFrameGenerator(width, height, absl::nullopt, absl::nullopt), - 30, *task_queue_factory); + 30, env.task_queue_factory()); frame_generators[i] = frame_generator; send_streams[i]->SetSource(frame_generator, DegradationPreference::MAINTAIN_FRAMERATE); diff --git a/third_party/libwebrtc/video/end_to_end_tests/network_state_tests.cc b/third_party/libwebrtc/video/end_to_end_tests/network_state_tests.cc index 7bc9f1493e..7e9c86362a 100644 --- a/third_party/libwebrtc/video/end_to_end_tests/network_state_tests.cc +++ b/third_party/libwebrtc/video/end_to_end_tests/network_state_tests.cc @@ -94,7 +94,7 @@ void NetworkStateEndToEndTest::VerifyNewVideoSendStreamsRespectNetworkState( SendTask(task_queue(), [this, network_to_bring_up, &encoder_factory, transport]() { - CreateSenderCall(CallConfig(send_event_log_.get())); + CreateSenderCall(); sender_call_->SignalChannelNetworkState(network_to_bring_up, kNetworkUp); CreateSendConfig(1, 0, 0, transport); diff --git a/third_party/libwebrtc/video/end_to_end_tests/stats_tests.cc b/third_party/libwebrtc/video/end_to_end_tests/stats_tests.cc index cc0b328b2b..d6820eeac2 100644 --- a/third_party/libwebrtc/video/end_to_end_tests/stats_tests.cc +++ b/third_party/libwebrtc/video/end_to_end_tests/stats_tests.cc @@ -518,9 +518,9 @@ TEST_F(StatsEndToEndTest, MAYBE_ContentTypeSwitches) { metrics::Reset(); - CallConfig send_config(send_event_log_.get()); + CallConfig send_config = SendCallConfig(); test.ModifySenderBitrateConfig(&send_config.bitrate_config); - CallConfig recv_config(recv_event_log_.get()); + CallConfig recv_config = RecvCallConfig(); test.ModifyReceiverBitrateConfig(&recv_config.bitrate_config); VideoEncoderConfig encoder_config_with_screenshare; @@ -732,13 +732,13 @@ TEST_F(StatsEndToEndTest, CallReportsRttForSender) { Start(); }); - int64_t start_time_ms = clock_->TimeInMilliseconds(); + int64_t start_time_ms = env().clock().TimeInMilliseconds(); while (true) { Call::Stats stats; SendTask(task_queue(), [this, &stats]() { stats = sender_call_->GetStats(); }); ASSERT_GE(start_time_ms + test::VideoTestConstants::kDefaultTimeout.ms(), - clock_->TimeInMilliseconds()) + env().clock().TimeInMilliseconds()) << "No RTT stats before timeout!"; if (stats.rtt_ms != -1) { // To avoid failures caused by rounding or minor ntp clock adjustments, |