“Michael | f9fc171 | 2018-08-27 10:08:58 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018 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 | |
| 11 | #include "rtc_base/experiments/rtt_mult_experiment.h" |
Yves Gerey | 3e70781 | 2018-11-28 16:47:49 +0100 | [diff] [blame^] | 12 | |
“Michael | f9fc171 | 2018-08-27 10:08:58 -0500 | [diff] [blame] | 13 | #include "test/field_trial.h" |
Yves Gerey | 3e70781 | 2018-11-28 16:47:49 +0100 | [diff] [blame^] | 14 | #include "test/gtest.h" |
“Michael | f9fc171 | 2018-08-27 10:08:58 -0500 | [diff] [blame] | 15 | |
| 16 | namespace webrtc { |
| 17 | |
| 18 | TEST(RttMultExperimentTest, RttMultDisabledByDefault) { |
| 19 | EXPECT_FALSE(RttMultExperiment::RttMultEnabled()); |
| 20 | } |
| 21 | |
| 22 | TEST(RttMultExperimentTest, RttMultEnabledByFieldTrial) { |
| 23 | webrtc::test::ScopedFieldTrials field_trials("WebRTC-RttMult/Enabled-0.25/"); |
| 24 | EXPECT_TRUE(RttMultExperiment::RttMultEnabled()); |
| 25 | } |
| 26 | |
| 27 | TEST(RttMultExperimentTest, RttMultTestValue) { |
| 28 | webrtc::test::ScopedFieldTrials field_trials("WebRTC-RttMult/Enabled-0.25/"); |
| 29 | EXPECT_EQ(0.25, RttMultExperiment::GetRttMultValue()); |
| 30 | } |
| 31 | |
| 32 | TEST(RttMultExperimentTest, RttMultTestMalformedEnabled) { |
| 33 | webrtc::test::ScopedFieldTrials field_trials("WebRTC-RttMult/Enable-0.25/"); |
| 34 | EXPECT_FALSE(RttMultExperiment::RttMultEnabled()); |
| 35 | } |
| 36 | |
| 37 | TEST(RttMultExperimentTest, RttMultTestValueOutOfBoundsPositive) { |
| 38 | webrtc::test::ScopedFieldTrials field_trials("WebRTC-RttMult/Enabled-1.5/"); |
| 39 | EXPECT_EQ(1.0, RttMultExperiment::GetRttMultValue()); |
| 40 | } |
| 41 | |
| 42 | TEST(RttMultExperimentTest, RttMultTestValueOutOfBoundsNegative) { |
| 43 | webrtc::test::ScopedFieldTrials field_trials("WebRTC-RttMult/Enabled--0.5/"); |
| 44 | EXPECT_EQ(0.0, RttMultExperiment::GetRttMultValue()); |
| 45 | } |
| 46 | |
| 47 | TEST(RttMultExperimentTest, RttMultTestMalformedValue) { |
| 48 | webrtc::test::ScopedFieldTrials field_trials("WebRTC-RttMult/Enabled-0.2a5/"); |
| 49 | EXPECT_NE(0.25, RttMultExperiment::GetRttMultValue()); |
| 50 | } |
| 51 | |
| 52 | } // namespace webrtc |