Adds SetForTest method on FieldTrialParameter class.
This is useful in tests as it allows overriding the default after
construction. It's not intended for use in production (as it can
be confusing to readers).
Bug: webrtc:10365
Change-Id: I8ac2541f2626e7fddbb61bdae72e9571ce9d7b97
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130468
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27389}
diff --git a/rtc_base/experiments/field_trial_parser.h b/rtc_base/experiments/field_trial_parser.h
index f723b3b..e6ae4c5 100644
--- a/rtc_base/experiments/field_trial_parser.h
+++ b/rtc_base/experiments/field_trial_parser.h
@@ -76,6 +76,8 @@
operator T() const { return Get(); }
const T* operator->() const { return &value_; }
+ void SetForTest(T value) { value_ = value; }
+
protected:
bool Parse(absl::optional<std::string> str_value) override {
if (str_value) {