2014-05-16 09:39:51 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "test/field_trial.h"
|
2014-05-16 09:39:51 +00:00
|
|
|
|
|
|
|
|
#include <algorithm>
|
|
|
|
|
#include <cassert>
|
|
|
|
|
#include <cstdio>
|
|
|
|
|
#include <cstdlib>
|
|
|
|
|
#include <map>
|
|
|
|
|
#include <string>
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "system_wrappers/include/field_trial.h"
|
2014-05-16 09:39:51 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
namespace test {
|
2019-06-11 14:29:40 +02:00
|
|
|
void ValidateFieldTrialsStringOrDie(const std::string&) {}
|
2015-07-07 08:22:27 -07:00
|
|
|
|
|
|
|
|
ScopedFieldTrials::ScopedFieldTrials(const std::string& config)
|
2016-01-08 05:04:57 -08:00
|
|
|
: previous_field_trials_(webrtc::field_trial::GetFieldTrialString()) {
|
|
|
|
|
current_field_trials_ = config;
|
2018-01-31 17:23:40 +01:00
|
|
|
webrtc::field_trial::InitFieldTrialsFromString(current_field_trials_.c_str());
|
2015-07-07 08:22:27 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ScopedFieldTrials::~ScopedFieldTrials() {
|
2016-01-08 05:04:57 -08:00
|
|
|
webrtc::field_trial::InitFieldTrialsFromString(previous_field_trials_);
|
2015-07-07 08:22:27 -07:00
|
|
|
}
|
|
|
|
|
|
2014-05-16 09:39:51 +00:00
|
|
|
} // namespace test
|
|
|
|
|
} // namespace webrtc
|