OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 uint8_t last_fraction_loss_; | 54 uint8_t last_fraction_loss_; |
55 int64_t last_rtt_; | 55 int64_t last_rtt_; |
56 }; | 56 }; |
57 | 57 |
58 class BitrateControllerTest : public ::testing::Test { | 58 class BitrateControllerTest : public ::testing::Test { |
59 protected: | 59 protected: |
60 BitrateControllerTest() : clock_(0) {} | 60 BitrateControllerTest() : clock_(0) {} |
61 ~BitrateControllerTest() {} | 61 ~BitrateControllerTest() {} |
62 | 62 |
63 virtual void SetUp() { | 63 virtual void SetUp() { |
64 controller_ = | 64 controller_ = BitrateController::CreateBitrateController( |
65 BitrateController::CreateBitrateController(&clock_, &bitrate_observer_); | 65 &clock_, &bitrate_observer_, nullptr); |
66 controller_->SetStartBitrate(kStartBitrateBps); | 66 controller_->SetStartBitrate(kStartBitrateBps); |
67 EXPECT_EQ(kStartBitrateBps, bitrate_observer_.last_bitrate_); | 67 EXPECT_EQ(kStartBitrateBps, bitrate_observer_.last_bitrate_); |
68 controller_->SetMinMaxBitrate(kMinBitrateBps, kMaxBitrateBps); | 68 controller_->SetMinMaxBitrate(kMinBitrateBps, kMaxBitrateBps); |
69 EXPECT_EQ(kStartBitrateBps, bitrate_observer_.last_bitrate_); | 69 EXPECT_EQ(kStartBitrateBps, bitrate_observer_.last_bitrate_); |
70 bandwidth_observer_ = controller_->CreateRtcpBandwidthObserver(); | 70 bandwidth_observer_ = controller_->CreateRtcpBandwidthObserver(); |
71 } | 71 } |
72 | 72 |
73 virtual void TearDown() { | 73 virtual void TearDown() { |
74 delete bandwidth_observer_; | 74 delete bandwidth_observer_; |
75 delete controller_; | 75 delete controller_; |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 EXPECT_EQ(120000, bitrate_observer_.last_bitrate_); | 392 EXPECT_EQ(120000, bitrate_observer_.last_bitrate_); |
393 controller_->SetReservedBitrate(50000); | 393 controller_->SetReservedBitrate(50000); |
394 bandwidth_observer_->OnReceivedEstimatedBitrate(120000); | 394 bandwidth_observer_->OnReceivedEstimatedBitrate(120000); |
395 // Limited by min bitrate. | 395 // Limited by min bitrate. |
396 EXPECT_EQ(100000, bitrate_observer_.last_bitrate_); | 396 EXPECT_EQ(100000, bitrate_observer_.last_bitrate_); |
397 | 397 |
398 controller_->SetReservedBitrate(10000); | 398 controller_->SetReservedBitrate(10000); |
399 bandwidth_observer_->OnReceivedEstimatedBitrate(1); | 399 bandwidth_observer_->OnReceivedEstimatedBitrate(1); |
400 EXPECT_EQ(100000, bitrate_observer_.last_bitrate_); | 400 EXPECT_EQ(100000, bitrate_observer_.last_bitrate_); |
401 } | 401 } |
OLD | NEW |