1 /*
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 
11 #include "modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h"
12 
13 #include "modules/remote_bitrate_estimator/remote_bitrate_estimator_unittest_helper.h"
14 #include "test/gtest.h"
15 
16 namespace webrtc {
17 
18 class RemoteBitrateEstimatorSingleTest : public RemoteBitrateEstimatorTest {
19  public:
RemoteBitrateEstimatorSingleTest()20   RemoteBitrateEstimatorSingleTest() {}
21 
22   RemoteBitrateEstimatorSingleTest(const RemoteBitrateEstimatorSingleTest&) =
23       delete;
24   RemoteBitrateEstimatorSingleTest& operator=(
25       const RemoteBitrateEstimatorSingleTest&) = delete;
26 
SetUp()27   virtual void SetUp() {
28     bitrate_estimator_.reset(new RemoteBitrateEstimatorSingleStream(
29         bitrate_observer_.get(), &clock_));
30   }
31 
32  protected:
33 };
34 
TEST_F(RemoteBitrateEstimatorSingleTest,InitialBehavior)35 TEST_F(RemoteBitrateEstimatorSingleTest, InitialBehavior) {
36   InitialBehaviorTestHelper(508017);
37 }
38 
TEST_F(RemoteBitrateEstimatorSingleTest,RateIncreaseReordering)39 TEST_F(RemoteBitrateEstimatorSingleTest, RateIncreaseReordering) {
40   RateIncreaseReorderingTestHelper(506422);
41 }
42 
TEST_F(RemoteBitrateEstimatorSingleTest,RateIncreaseRtpTimestamps)43 TEST_F(RemoteBitrateEstimatorSingleTest, RateIncreaseRtpTimestamps) {
44   RateIncreaseRtpTimestampsTestHelper(1267);
45 }
46 
TEST_F(RemoteBitrateEstimatorSingleTest,CapacityDropOneStream)47 TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropOneStream) {
48   CapacityDropTestHelper(1, false, 633, 0);
49 }
50 
TEST_F(RemoteBitrateEstimatorSingleTest,CapacityDropOneStreamWrap)51 TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropOneStreamWrap) {
52   CapacityDropTestHelper(1, true, 633, 0);
53 }
54 
TEST_F(RemoteBitrateEstimatorSingleTest,CapacityDropTwoStreamsWrap)55 TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropTwoStreamsWrap) {
56   CapacityDropTestHelper(2, true, 767, 0);
57 }
58 
TEST_F(RemoteBitrateEstimatorSingleTest,CapacityDropThreeStreamsWrap)59 TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropThreeStreamsWrap) {
60   CapacityDropTestHelper(3, true, 567, 0);
61 }
62 
TEST_F(RemoteBitrateEstimatorSingleTest,CapacityDropThirteenStreamsWrap)63 TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropThirteenStreamsWrap) {
64   CapacityDropTestHelper(13, true, 567, 0);
65 }
66 
TEST_F(RemoteBitrateEstimatorSingleTest,CapacityDropNineteenStreamsWrap)67 TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropNineteenStreamsWrap) {
68   CapacityDropTestHelper(19, true, 700, 0);
69 }
70 
TEST_F(RemoteBitrateEstimatorSingleTest,CapacityDropThirtyStreamsWrap)71 TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropThirtyStreamsWrap) {
72   CapacityDropTestHelper(30, true, 733, 0);
73 }
74 
TEST_F(RemoteBitrateEstimatorSingleTest,TestTimestampGrouping)75 TEST_F(RemoteBitrateEstimatorSingleTest, TestTimestampGrouping) {
76   TestTimestampGroupingTestHelper();
77 }
78 }  // namespace webrtc
79