Resetting the global state between runs was previously handled by a
RAII type, but the semantics of that type changed to remove this
behavior in [1].
[1] https://webrtc-review.googlesource.com/c/src/+/276269
Bug: webrtc:14731, webrtc:14705
Change-Id: I8425cb71f49ea000434d500e0b3978324e4c3195
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285782
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38800}
This new name emphasizes that the field trial keys are only allowed
within the current scope. We already have test::ScopedFieldTrials that
can be used to ensure that the global field trials string itself is
isolated.
Bug: webrtc:14705
Change-Id: I8b66bbd9c11d97985292c334d2d3496a047074a1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/284862
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38796}
This new class implements the existing FieldTrialsView interface,
extending it with the verification functionality. For now, the
verification will only be performed if the rtc_strict_field_trials GN
arg is set.
Most classes extending FieldTrialsView today have been converted to
extend from FieldTrialsRegistry instead to automatically perform
verification.
Bug: webrtc:14154
Change-Id: I4819724cd66a04507e62fcc2bb1019187b6ba8c7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276270
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38453}
For now, the run-time check will only be enabled if the
rtc_strict_field_trials GN arg is set.
In order to allow testing with imaginary field trial keys, two test
helpers have been added. It's a bit awkward to test these since the
field trial string is already global, hence the helpers are also
modifying global state. Tests must make sure this global state is reset
between runs. Things won't be an issue anymore when [1] has removed the
global string.
[1] https://crbug.com/webrtc/10335
Bug: webrtc:14154
Change-Id: Ida44cc817079d7177325e2228cf1f1d242b799e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276269
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38447}
Calling InitFieldTrialsFromString modifies a global variable so we must
make sure that state is reset between test runs.
Bug: webrtc:10335, webrtc:14336
Change-Id: Ia9839dd16a330ed3220ed470c28c541fc1cc0678
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271022
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Emil Lundmark <lndmrk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37731}
This renames the tests to also capture the expected outcome of the test
along with some minor code cleanups. Some tests have also been added or
extended to tests more invariants.
Bug: None
Change-Id: I0bc733026118eb90646929b164bfc148665556a8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267169
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Auto-Submit: Emil Lundmark <lndmrk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37673}
This cl/ creates a constructor for a FieldTrials object that is
not backed by the global string. Use with care!
Bug: webrtc:10335
Change-Id: I8c48d1e8bb52fef78524d890cc90473355be617f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264461
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37057}
Create FieldTrials class for setting the field trials from a string
in a program. We can later e.g add a builder class where one
can add key/value pairs.
This class is supposed to replace
webrtc::field_trial::InitFieldTrialsFromString.
No-Try: True
Bug: webrtc:10335
Change-Id: I17f45e401102fddda50ca7c4a04bea2f1cb87788
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256973
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36376}