blob: d0a7b22505c35ef6574c909516e6dc8bc6036d0e [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"
Yves Gerey3e707812018-11-28 16:47:49 +010012
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020013#include "modules/remote_bitrate_estimator/remote_bitrate_estimator_unittest_helper.h"
Steve Anton10542f22019-01-11 09:11:00 -080014#include "rtc_base/constructor_magic.h"
Yves Gerey3e707812018-11-28 16:47:49 +010015#include "test/gtest.h"
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000016
17namespace webrtc {
18
Yves Gerey665174f2018-06-19 15:03:05 +020019class RemoteBitrateEstimatorSingleTest : public RemoteBitrateEstimatorTest {
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000020 public:
21 RemoteBitrateEstimatorSingleTest() {}
22 virtual void SetUp() {
Erik Språng468e62a2015-07-06 10:50:47 +020023 bitrate_estimator_.reset(new RemoteBitrateEstimatorSingleStream(
stefan4fbd1452015-09-28 03:57:14 -070024 bitrate_observer_.get(), &clock_));
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000025 }
Yves Gerey665174f2018-06-19 15:03:05 +020026
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000027 protected:
henrikg3c089d72015-09-16 05:37:44 -070028 RTC_DISALLOW_COPY_AND_ASSIGN(RemoteBitrateEstimatorSingleTest);
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000029};
30
31TEST_F(RemoteBitrateEstimatorSingleTest, InitialBehavior) {
pbos@webrtc.org9f79fe62014-12-04 15:34:06 +000032 InitialBehaviorTestHelper(508017);
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000033}
34
35TEST_F(RemoteBitrateEstimatorSingleTest, RateIncreaseReordering) {
pbos@webrtc.org9f79fe62014-12-04 15:34:06 +000036 RateIncreaseReorderingTestHelper(506422);
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000037}
38
39TEST_F(RemoteBitrateEstimatorSingleTest, RateIncreaseRtpTimestamps) {
Erik Språng51e60302016-06-10 22:13:21 +020040 RateIncreaseRtpTimestampsTestHelper(1267);
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000041}
42
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000043TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropOneStream) {
stefan5e12d362016-07-11 01:44:02 -070044 CapacityDropTestHelper(1, false, 633, 0);
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000045}
46
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000047TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropOneStreamWrap) {
stefan5e12d362016-07-11 01:44:02 -070048 CapacityDropTestHelper(1, true, 633, 0);
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000049}
50
solenberg@webrtc.org91811e22013-06-25 20:36:14 +000051TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropTwoStreamsWrap) {
stefan5e12d362016-07-11 01:44:02 -070052 CapacityDropTestHelper(2, true, 767, 0);
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000053}
54
solenberg@webrtc.org91811e22013-06-25 20:36:14 +000055TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropThreeStreamsWrap) {
stefan5e12d362016-07-11 01:44:02 -070056 CapacityDropTestHelper(3, true, 567, 0);
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000057}
58
59TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropThirteenStreamsWrap) {
Sebastian Jansson5f009952018-11-19 18:02:20 +010060 CapacityDropTestHelper(13, true, 567, 0);
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000061}
62
63TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropNineteenStreamsWrap) {
stefan5e12d362016-07-11 01:44:02 -070064 CapacityDropTestHelper(19, true, 700, 0);
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000065}
66
67TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropThirtyStreamsWrap) {
stefan5e12d362016-07-11 01:44:02 -070068 CapacityDropTestHelper(30, true, 733, 0);
pbos@webrtc.org9f79fe62014-12-04 15:34:06 +000069}
70
71TEST_F(RemoteBitrateEstimatorSingleTest, TestTimestampGrouping) {
Stefan Holmer11324b92015-07-09 17:27:48 +020072 TestTimestampGroupingTestHelper();
solenberg@webrtc.org561990f2013-05-22 19:04:19 +000073}
74} // namespace webrtc