blob: 25cebbcd70e623767c3a2e80e51b971e22ff5ca0 [file] [log] [blame]
Rasmus Brandt3dde4502019-03-21 11:46:17 +01001/*
2 * Copyright 2019 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/keyframe_interval_settings.h"
Jonas Olssona4d87372019-07-05 19:08:33 +020012
Rasmus Brandt3dde4502019-03-21 11:46:17 +010013#include "test/field_trial.h"
14#include "test/gtest.h"
15
16namespace webrtc {
17namespace {
18
19TEST(KeyframeIntervalSettingsTest, ParsesMinKeyframeSendIntervalMs) {
20 EXPECT_FALSE(KeyframeIntervalSettings::ParseFromFieldTrials()
21 .MinKeyframeSendIntervalMs());
22
23 test::ScopedFieldTrials field_trials(
24 "WebRTC-KeyframeInterval/min_keyframe_send_interval_ms:100/");
25 EXPECT_EQ(KeyframeIntervalSettings::ParseFromFieldTrials()
26 .MinKeyframeSendIntervalMs(),
27 100);
28}
29
Erik Språngac732f62021-03-24 15:18:57 +010030TEST(KeyframeIntervalSettingsTest, DoesNotParseIncorrectValues) {
Rasmus Brandt3dde4502019-03-21 11:46:17 +010031 EXPECT_FALSE(KeyframeIntervalSettings::ParseFromFieldTrials()
32 .MinKeyframeSendIntervalMs());
Erik Språngac732f62021-03-24 15:18:57 +010033
34 test::ScopedFieldTrials field_trials(
35 "WebRTC-KeyframeInterval/min_keyframe_send_interval_ms:a/");
36 EXPECT_FALSE(KeyframeIntervalSettings::ParseFromFieldTrials()
37 .MinKeyframeSendIntervalMs());
38 EXPECT_FALSE(KeyframeIntervalSettings::ParseFromFieldTrials()
39 .MinKeyframeSendIntervalMs());
Rasmus Brandt3dde4502019-03-21 11:46:17 +010040}
41
42} // namespace
43} // namespace webrtc