mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 05:40:42 +01:00
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}
This commit is contained in:
parent
8f1159b518
commit
d7f9550647
2 changed files with 5 additions and 1 deletions
|
@ -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" ]
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue