OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #include "webrtc/base/constructormagic.h" | 11 #include "webrtc/base/constructormagic.h" |
12 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_s
end_time.h" | 12 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_s
end_time.h" |
13 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_unitt
est_helper.h" | 13 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_unitt
est_helper.h" |
14 | 14 |
15 namespace webrtc { | 15 namespace webrtc { |
16 | 16 |
17 class RemoteBitrateEstimatorAbsSendTimeTest : | 17 class RemoteBitrateEstimatorAbsSendTimeTest : |
18 public RemoteBitrateEstimatorTest { | 18 public RemoteBitrateEstimatorTest { |
19 public: | 19 public: |
20 static const uint32_t kRemoteBitrateEstimatorMinBitrateBps = 30000; | 20 static const uint32_t kRemoteBitrateEstimatorMinBitrateBps = 30000; |
21 | 21 |
22 RemoteBitrateEstimatorAbsSendTimeTest() {} | 22 RemoteBitrateEstimatorAbsSendTimeTest() {} |
23 virtual void SetUp() { | 23 virtual void SetUp() { |
24 bitrate_estimator_.reset(new RemoteBitrateEstimatorAbsSendTime( | 24 bitrate_estimator_.reset(new RemoteBitrateEstimatorAbsSendTime( |
25 bitrate_observer_.get(), &clock_, | 25 bitrate_observer_.get(), &clock_, |
26 kRemoteBitrateEstimatorMinBitrateBps)); | 26 kRemoteBitrateEstimatorMinBitrateBps)); |
27 } | 27 } |
28 protected: | 28 protected: |
29 DISALLOW_COPY_AND_ASSIGN(RemoteBitrateEstimatorAbsSendTimeTest); | 29 RTC_DISALLOW_COPY_AND_ASSIGN(RemoteBitrateEstimatorAbsSendTimeTest); |
30 }; | 30 }; |
31 | 31 |
32 TEST_F(RemoteBitrateEstimatorAbsSendTimeTest, InitialBehavior) { | 32 TEST_F(RemoteBitrateEstimatorAbsSendTimeTest, InitialBehavior) { |
33 InitialBehaviorTestHelper(508017); | 33 InitialBehaviorTestHelper(508017); |
34 } | 34 } |
35 | 35 |
36 TEST_F(RemoteBitrateEstimatorAbsSendTimeTest, RateIncreaseReordering) { | 36 TEST_F(RemoteBitrateEstimatorAbsSendTimeTest, RateIncreaseReordering) { |
37 RateIncreaseReorderingTestHelper(506422); | 37 RateIncreaseReorderingTestHelper(506422); |
38 } | 38 } |
39 | 39 |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 } | 285 } |
286 | 286 |
287 // Wait long enough so that we can call Process again. | 287 // Wait long enough so that we can call Process again. |
288 clock_.AdvanceTimeMilliseconds(1000); | 288 clock_.AdvanceTimeMilliseconds(1000); |
289 | 289 |
290 EXPECT_EQ(0, bitrate_estimator_->Process()); | 290 EXPECT_EQ(0, bitrate_estimator_->Process()); |
291 EXPECT_TRUE(bitrate_observer_->updated()); | 291 EXPECT_TRUE(bitrate_observer_->updated()); |
292 EXPECT_NEAR(bitrate_observer_->latest_bitrate(), 800000u, 10000); | 292 EXPECT_NEAR(bitrate_observer_->latest_bitrate(), 800000u, 10000); |
293 } | 293 } |
294 } // namespace webrtc | 294 } // namespace webrtc |
OLD | NEW |