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 "testing/gtest/include/gtest/gtest.h" 12 13#include "webrtc/base/constructormagic.h" 14#include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_unittest_helper.h" 15 16namespace webrtc { 17 18class RemoteBitrateEstimatorSingleTest : public RemoteBitrateEstimatorTest { 19 public: 20 static const uint32_t kRemoteBitrateEstimatorMinBitrateBps = 30000; 21 22 RemoteBitrateEstimatorSingleTest() {} 23 virtual void SetUp() { 24 bitrate_estimator_.reset(RemoteBitrateEstimatorFactory().Create( 25 bitrate_observer_.get(), 26 &clock_, 27 kMimdControl, 28 kRemoteBitrateEstimatorMinBitrateBps)); 29 } 30 protected: 31 DISALLOW_COPY_AND_ASSIGN(RemoteBitrateEstimatorSingleTest); 32}; 33 34TEST_F(RemoteBitrateEstimatorSingleTest, InitialBehavior) { 35 InitialBehaviorTestHelper(498075); 36} 37 38TEST_F(RemoteBitrateEstimatorSingleTest, RateIncreaseReordering) { 39 RateIncreaseReorderingTestHelper(498136); 40} 41 42TEST_F(RemoteBitrateEstimatorSingleTest, RateIncreaseRtpTimestamps) { 43 RateIncreaseRtpTimestampsTestHelper(); 44} 45 46// Verify that the time it takes for the estimator to reduce the bitrate when 47// the capacity is tightened stays the same. 48TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropOneStream) { 49 CapacityDropTestHelper(1, false, 956214, 367); 50} 51 52// Verify that the time it takes for the estimator to reduce the bitrate when 53// the capacity is tightened stays the same. This test also verifies that we 54// handle wrap-arounds in this scenario. 55TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropOneStreamWrap) { 56 CapacityDropTestHelper(1, true, 956214, 367); 57} 58 59// Verify that the time it takes for the estimator to reduce the bitrate when 60// the capacity is tightened stays the same. This test also verifies that we 61// handle wrap-arounds in this scenario. This is a multi-stream test. 62TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropTwoStreamsWrap) { 63 CapacityDropTestHelper(2, true, 927088, 267); 64} 65 66// Verify that the time it takes for the estimator to reduce the bitrate when 67// the capacity is tightened stays the same. This test also verifies that we 68// handle wrap-arounds in this scenario. This is a multi-stream test. 69TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropThreeStreamsWrap) { 70 CapacityDropTestHelper(3, true, 920944, 333); 71} 72 73TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropThirteenStreamsWrap) { 74 CapacityDropTestHelper(13, true, 938944, 300); 75} 76 77TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropNineteenStreamsWrap) { 78 CapacityDropTestHelper(19, true, 926718, 300); 79} 80 81TEST_F(RemoteBitrateEstimatorSingleTest, CapacityDropThirtyStreamsWrap) { 82 CapacityDropTestHelper(30, true, 927016, 300); 83} 84} // namespace webrtc 85