Set scoped field trials in encode/decode test

Since not all codecs read field trials from the environment yet.

Bug: webrtc:14852
Change-Id: Ia2477c41d09dabf91f47c59eb3139d6d6a711548
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/339380
Auto-Submit: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41731}
This commit is contained in:
Sergey Silkin 2024-02-12 17:19:06 +01:00 committed by WebRTC LUCI CQ
parent 94c3328b61
commit 2bd4129e91
2 changed files with 3 additions and 0 deletions

View File

@ -1015,6 +1015,7 @@ if (rtc_include_tests) {
"../../rtc_base:logging",
"../../rtc_base:stringutils",
"../../test:explicit_key_value_config",
"../../test:field_trial",
"../../test:fileutils",
"../../test:test_flags",
"../../test:test_main",

View File

@ -29,6 +29,7 @@
#include "rtc_base/logging.h"
#include "rtc_base/strings/string_builder.h"
#include "test/explicit_key_value_config.h"
#include "test/field_trial.h"
#include "test/gtest.h"
#include "test/test_flags.h"
#include "test/testsupport/file_utils.h"
@ -533,6 +534,7 @@ INSTANTIATE_TEST_SUITE_P(
FramerateAdaptationTest::TestParamsToString);
TEST(VideoCodecTest, DISABLED_EncodeDecode) {
ScopedFieldTrials field_trials(absl::GetFlag(FLAGS_field_trials));
const Environment env =
CreateEnvironment(std::make_unique<ExplicitKeyValueConfig>(
absl::GetFlag(FLAGS_field_trials)));