From 8dd16259287f58f9273002717ec4d27e97127719 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:43:14 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- third_party/libwebrtc/api/video_codecs/test/BUILD.gn | 3 +++ .../video_decoder_software_fallback_wrapper_unittest.cc | 15 ++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'third_party/libwebrtc/api/video_codecs/test') diff --git a/third_party/libwebrtc/api/video_codecs/test/BUILD.gn b/third_party/libwebrtc/api/video_codecs/test/BUILD.gn index 7bfe86e9f4..be897ae124 100644 --- a/third_party/libwebrtc/api/video_codecs/test/BUILD.gn +++ b/third_party/libwebrtc/api/video_codecs/test/BUILD.gn @@ -39,10 +39,13 @@ if (rtc_include_tests) { "../../../modules/video_coding:webrtc_vp8", "../../../rtc_base:checks", "../../../rtc_base:rtc_base_tests_utils", + "../../../test:explicit_key_value_config", "../../../test:fake_video_codecs", "../../../test:field_trial", "../../../test:test_support", "../../../test:video_test_common", + "../../environment", + "../../environment:environment_factory", "../../video:encoded_image", "../../video:video_bitrate_allocation", "../../video:video_frame", diff --git a/third_party/libwebrtc/api/video_codecs/test/video_decoder_software_fallback_wrapper_unittest.cc b/third_party/libwebrtc/api/video_codecs/test/video_decoder_software_fallback_wrapper_unittest.cc index 97be6250db..bd837605b0 100644 --- a/third_party/libwebrtc/api/video_codecs/test/video_decoder_software_fallback_wrapper_unittest.cc +++ b/third_party/libwebrtc/api/video_codecs/test/video_decoder_software_fallback_wrapper_unittest.cc @@ -13,6 +13,8 @@ #include #include "absl/types/optional.h" +#include "api/environment/environment.h" +#include "api/environment/environment_factory.h" #include "api/video/encoded_image.h" #include "api/video/video_frame.h" #include "api/video_codecs/video_decoder.h" @@ -20,7 +22,7 @@ #include "modules/video_coding/include/video_codec_interface.h" #include "modules/video_coding/include/video_error_codes.h" #include "rtc_base/checks.h" -#include "test/field_trial.h" +#include "test/explicit_key_value_config.h" #include "test/gtest.h" namespace webrtc { @@ -31,10 +33,12 @@ class VideoDecoderSoftwareFallbackWrapperTest : public ::testing::Test { : VideoDecoderSoftwareFallbackWrapperTest("") {} explicit VideoDecoderSoftwareFallbackWrapperTest( const std::string& field_trials) - : override_field_trials_(field_trials), + : field_trials_(field_trials), + env_(CreateEnvironment(&field_trials_)), fake_decoder_(new CountingFakeDecoder()), fallback_wrapper_(CreateVideoDecoderSoftwareFallbackWrapper( - std::unique_ptr(VP8Decoder::Create()), + env_, + CreateVp8Decoder(env_), std::unique_ptr(fake_decoder_))) {} class CountingFakeDecoder : public VideoDecoder { @@ -71,7 +75,8 @@ class VideoDecoderSoftwareFallbackWrapperTest : public ::testing::Test { int release_count_ = 0; int reset_count_ = 0; }; - test::ScopedFieldTrials override_field_trials_; + test::ExplicitKeyValueConfig field_trials_; + const Environment env_; // `fake_decoder_` is owned and released by `fallback_wrapper_`. CountingFakeDecoder* fake_decoder_; std::unique_ptr fallback_wrapper_; @@ -275,7 +280,7 @@ class ForcedSoftwareDecoderFallbackTest fake_decoder_ = new CountingFakeDecoder(); sw_fallback_decoder_ = new CountingFakeDecoder(); fallback_wrapper_ = CreateVideoDecoderSoftwareFallbackWrapper( - std::unique_ptr(sw_fallback_decoder_), + env_, std::unique_ptr(sw_fallback_decoder_), std::unique_ptr(fake_decoder_)); } -- cgit v1.2.3