| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include "webrtc/test/field_trial.h" | 11 #include "webrtc/test/field_trial.h" |
| 12 | 12 |
| 13 #include <algorithm> | 13 #include <algorithm> |
| 14 #include <cassert> | 14 #include <cassert> |
| 15 #include <cstdio> | 15 #include <cstdio> |
| 16 #include <cstdlib> | 16 #include <cstdlib> |
| 17 #include <map> | 17 #include <map> |
| 18 #include <string> | 18 #include <string> |
| 19 | 19 |
| 20 #include "webrtc/system_wrappers/interface/field_trial.h" | 20 #include "webrtc/system_wrappers/include/field_trial.h" |
| 21 | 21 |
| 22 namespace webrtc { | 22 namespace webrtc { |
| 23 namespace { | 23 namespace { |
| 24 // Clients of this library have show a clear intent to setup field trials by | 24 // Clients of this library have show a clear intent to setup field trials by |
| 25 // linking with it. As so try to crash if they forget to call | 25 // linking with it. As so try to crash if they forget to call |
| 26 // InitFieldTrialsFromString before webrtc tries to access a field trial. | 26 // InitFieldTrialsFromString before webrtc tries to access a field trial. |
| 27 bool field_trials_initiated_ = false; | 27 bool field_trials_initiated_ = false; |
| 28 std::map<std::string, std::string> field_trials_; | 28 std::map<std::string, std::string> field_trials_; |
| 29 } // namespace | 29 } // namespace |
| 30 | 30 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 ScopedFieldTrials::~ScopedFieldTrials() { | 95 ScopedFieldTrials::~ScopedFieldTrials() { |
| 96 // Should still be initialized, since InitFieldTrials is called from ctor. | 96 // Should still be initialized, since InitFieldTrials is called from ctor. |
| 97 // That's why we don't restore the flag. | 97 // That's why we don't restore the flag. |
| 98 assert(field_trials_initiated_); | 98 assert(field_trials_initiated_); |
| 99 field_trials_ = previous_field_trials_; | 99 field_trials_ = previous_field_trials_; |
| 100 } | 100 } |
| 101 | 101 |
| 102 } // namespace test | 102 } // namespace test |
| 103 } // namespace webrtc | 103 } // namespace webrtc |
| OLD | NEW |