Use ScopedFieldTrials instead of InitFieldTrialsFromString in InternalDecoderFactoryTest.

Bug: webrtc:14698
Change-Id: I47ec906b258cd2b613c863cad6a0318d71a1fa32
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/284840
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38717}
This commit is contained in:
philipel
2022-11-23 10:36:27 +01:00
committed by WebRTC LUCI CQ
parent 6a8776a108
commit 46e2d103b4

View File

@ -16,6 +16,7 @@
#include "api/video_codecs/vp9_profile.h" #include "api/video_codecs/vp9_profile.h"
#include "media/base/media_constants.h" #include "media/base/media_constants.h"
#include "system_wrappers/include/field_trial.h" #include "system_wrappers/include/field_trial.h"
#include "test/field_trial.h"
#include "test/gmock.h" #include "test/gmock.h"
#include "test/gtest.h" #include "test/gtest.h"
@ -122,7 +123,7 @@ TEST(InternalDecoderFactoryTest, Av1Profile1_Dav1dDecoderTrialEnabled) {
} }
TEST(InternalDecoderFactoryTest, Av1Profile1_Dav1dDecoderTrialDisabled) { TEST(InternalDecoderFactoryTest, Av1Profile1_Dav1dDecoderTrialDisabled) {
InitFieldTrialsFromString(kDav1dDecoderFieldTrialDisabled); test::ScopedFieldTrials disable_dav1d(kDav1dDecoderFieldTrialDisabled);
InternalDecoderFactory factory; InternalDecoderFactory factory;
std::unique_ptr<VideoDecoder> decoder = factory.CreateVideoDecoder( std::unique_ptr<VideoDecoder> decoder = factory.CreateVideoDecoder(
SdpVideoFormat(cricket::kAv1CodecName, SdpVideoFormat(cricket::kAv1CodecName,