blob: c4bb76bb23f257f066c161904833f3feaaaedce9 [file] [log] [blame]
solenberg@webrtc.org561990f2013-05-22 19:04:19 +00001/*
2 * Copyright (c) 2013 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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#include "modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h"
12#include "modules/remote_bitrate_estimator/remote_bitrate_estimator_unittest_helper.h"
13#include "rtc_base/constructormagic.h"
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000014
15namespace webrtc {
16
pbos@webrtc.org9f79fe62014-12-04 15:34:06 +000017class RemoteBitrateEstimatorSingleTest :
18 public RemoteBitrateEstimatorTest {
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000019 public:
20 RemoteBitrateEstimatorSingleTest() {}
21 virtual void SetUp() {
Erik Språng468e62a2015-07-06 10:50:47 +020022 bitrate_estimator_.reset(new RemoteBitrateEstimatorSingleStream(
stefan4fbd1452015-09-28 03:57:14 -070023 bitrate_observer_.get(), &clock_));
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000024 }
25 protected:
henrikg3c089d72015-09-16 05:37:44 -070026 RTC_DISALLOW_COPY_AND_ASSIGN(RemoteBitrateEstimatorSingleTest);
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000027};
28
29TEST_F(RemoteBitrateEstimatorSingleTest, InitialBehavior) {
pbos@webrtc.org9f79fe62014-12-04 15:34:06 +000030 InitialBehaviorTestHelper(508017);
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000031}
32
33TEST_F(RemoteBitrateEstimatorSingleTest, RateIncreaseReordering) {
pbos@webrtc.org9f79fe62014-12-04 15:34:06 +000034 RateIncreaseReorderingTestHelper(506422);
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000035}
36
37TEST_F(RemoteBitrateEstimatorSingleTest, RateIncreaseRtpTimestamps) {
Erik Språng51e60302016-06-10 22:13:21 +020038 RateIncreaseRtpTimestampsTestHelper(1267);
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000039}
40
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000041TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropOneStream) {
stefan5e12d362016-07-11 01:44:02 -070042 CapacityDropTestHelper(1, false, 633, 0);
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000043}
44
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000045TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropOneStreamWrap) {
stefan5e12d362016-07-11 01:44:02 -070046 CapacityDropTestHelper(1, true, 633, 0);
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000047}
48
solenberg@webrtc.org91811e22013-06-25 20:36:14 +000049TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropTwoStreamsWrap) {
stefan5e12d362016-07-11 01:44:02 -070050 CapacityDropTestHelper(2, true, 767, 0);
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000051}
52
solenberg@webrtc.org91811e22013-06-25 20:36:14 +000053TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropThreeStreamsWrap) {
stefan5e12d362016-07-11 01:44:02 -070054 CapacityDropTestHelper(3, true, 567, 0);
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000055}
56
57TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropThirteenStreamsWrap) {
michaelt4a4b3cf2016-11-17 01:18:43 -080058 CapacityDropTestHelper(13, true, 733, 0);
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000059}
60
61TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropNineteenStreamsWrap) {
stefan5e12d362016-07-11 01:44:02 -070062 CapacityDropTestHelper(19, true, 700, 0);
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000063}
64
65TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropThirtyStreamsWrap) {
stefan5e12d362016-07-11 01:44:02 -070066 CapacityDropTestHelper(30, true, 733, 0);
pbos@webrtc.org9f79fe62014-12-04 15:34:06 +000067}
68
69TEST_F(RemoteBitrateEstimatorSingleTest, TestTimestampGrouping) {
Stefan Holmer11324b92015-07-09 17:27:48 +020070 TestTimestampGroupingTestHelper();
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000071}
72} // namespace webrtc