Fix interaction between ScopedkeyValueConfig and global field trials string

This patch fixes a problem for test programs that mix usage of
ScopedKeyValueConfig and the global field trial string.

In this case, tests that were using CallTest.

The solution is to check the global string when nothing has been explicitly added to a ScopedKeyValueConfig.

Bug: webrtc:13828
Change-Id: Ib89735670cfe93340ca0a8bac53f8a64a600ad66
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256366
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36294}
diff --git a/test/BUILD.gn b/test/BUILD.gn
index ae0f3ba..e9d63ca 100644
--- a/test/BUILD.gn
+++ b/test/BUILD.gn
@@ -251,6 +251,7 @@
     ":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 723be22..d6090b7 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 @@
     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