diff --git a/test/BUILD.gn b/test/BUILD.gn index ae0f3ba8d3..e9d63ca42b 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -251,6 +251,7 @@ rtc_library("scoped_key_value_config") { ":field_trial", "../api:webrtc_key_value_config", "../rtc_base:checks", + "../system_wrappers:field_trial", ] absl_deps = [ "//third_party/abseil-cpp/absl/strings:strings" ] } diff --git a/test/scoped_key_value_config.cc b/test/scoped_key_value_config.cc index 723be22261..d6090b7f31 100644 --- a/test/scoped_key_value_config.cc +++ b/test/scoped_key_value_config.cc @@ -12,6 +12,7 @@ #include "api/webrtc_key_value_config.h" #include "rtc_base/checks.h" +#include "system_wrappers/include/field_trial.h" #include "test/field_trial.h" namespace { @@ -112,7 +113,9 @@ std::string ScopedKeyValueConfig::LookupRecurse(absl::string_view key) const { return parent_->LookupRecurse(key); } - return ""; + // When at the root, check the global string so that test programs using + // a mix between ScopedKeyValueConfig and the global string continue to work + return webrtc::field_trial::FindFullName(std::string(key)); } } // namespace test