blob: 80fee0c427a1cde00e8187cd410580678913d36c [file] [log] [blame]
andresp@webrtc.org60015d22014-05-16 09:39:51 +00001/*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#include "test/field_trial.h"
andresp@webrtc.org60015d22014-05-16 09:39:51 +000012
13#include <algorithm>
14#include <cassert>
15#include <cstdio>
16#include <cstdlib>
17#include <map>
18#include <string>
19
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020020#include "system_wrappers/include/field_trial.h"
andresp@webrtc.org60015d22014-05-16 09:39:51 +000021
22namespace webrtc {
andresp@webrtc.org60015d22014-05-16 09:39:51 +000023namespace test {
Jonas Olsson5b2eda42019-06-11 14:29:40 +020024void ValidateFieldTrialsStringOrDie(const std::string&) {}
pbos19492f12015-07-07 08:22:27 -070025
26ScopedFieldTrials::ScopedFieldTrials(const std::string& config)
Yves Gerey665174f2018-06-19 15:03:05 +020027 : previous_field_trials_(webrtc::field_trial::GetFieldTrialString()) {
phoglund37ebcf02016-01-08 05:04:57 -080028 current_field_trials_ = config;
Bjorn Tereliusedab3012018-01-31 17:23:40 +010029 webrtc::field_trial::InitFieldTrialsFromString(current_field_trials_.c_str());
pbos19492f12015-07-07 08:22:27 -070030}
31
32ScopedFieldTrials::~ScopedFieldTrials() {
phoglund37ebcf02016-01-08 05:04:57 -080033 webrtc::field_trial::InitFieldTrialsFromString(previous_field_trials_);
pbos19492f12015-07-07 08:22:27 -070034}
35
andresp@webrtc.org60015d22014-05-16 09:39:51 +000036} // namespace test
37} // namespace webrtc