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
|
|
|
#ifndef TEST_FIELD_TRIAL_H_
|
|
|
|
|
#define TEST_FIELD_TRIAL_H_
|
2014-05-16 09:39:51 +00:00
|
|
|
|
2015-07-07 08:22:27 -07:00
|
|
|
#include <map>
|
2018-06-19 15:03:05 +02:00
|
|
|
#include <string>
|
2014-05-16 09:39:51 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
namespace test {
|
2019-06-11 14:29:40 +02:00
|
|
|
// TODO(jonasolsson): remove once all internal usages are gone.
|
|
|
|
|
void ValidateFieldTrialsStringOrDie(const std::string&);
|
2014-05-16 09:39:51 +00:00
|
|
|
|
2015-07-07 08:22:27 -07:00
|
|
|
// This class is used to override field-trial configs within specific tests.
|
|
|
|
|
// After this class goes out of scope previous field trials will be restored.
|
|
|
|
|
class ScopedFieldTrials {
|
|
|
|
|
public:
|
|
|
|
|
explicit ScopedFieldTrials(const std::string& config);
|
2019-03-22 15:42:38 +01:00
|
|
|
ScopedFieldTrials(const ScopedFieldTrials&) = delete;
|
|
|
|
|
ScopedFieldTrials& operator=(const ScopedFieldTrials&) = delete;
|
2015-07-07 08:22:27 -07:00
|
|
|
~ScopedFieldTrials();
|
2018-06-19 15:03:05 +02:00
|
|
|
|
2015-07-07 08:22:27 -07:00
|
|
|
private:
|
2016-01-08 05:04:57 -08:00
|
|
|
std::string current_field_trials_;
|
|
|
|
|
const char* previous_field_trials_;
|
2015-07-07 08:22:27 -07:00
|
|
|
};
|
|
|
|
|
|
2014-05-16 09:39:51 +00:00
|
|
|
} // namespace test
|
|
|
|
|
} // namespace webrtc
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#endif // TEST_FIELD_TRIAL_H_
|