Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 #include <memory> | 10 #include <memory> |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 TEST_F(ProbeControllerTest, InitiatesProbingAtStart) { | 46 TEST_F(ProbeControllerTest, InitiatesProbingAtStart) { |
| 47 EXPECT_CALL(pacer_, CreateProbeCluster(_, _)).Times(AtLeast(2)); | 47 EXPECT_CALL(pacer_, CreateProbeCluster(_, _)).Times(AtLeast(2)); |
| 48 probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps, | 48 probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps, |
| 49 kMaxBitrateBps); | 49 kMaxBitrateBps); |
| 50 } | 50 } |
| 51 | 51 |
| 52 TEST_F(ProbeControllerTest, InitiatesProbingOnMaxBitrateIncrease) { | 52 TEST_F(ProbeControllerTest, InitiatesProbingOnMaxBitrateIncrease) { |
| 53 EXPECT_CALL(pacer_, CreateProbeCluster(_, _)).Times(AtLeast(2)); | 53 EXPECT_CALL(pacer_, CreateProbeCluster(_, _)).Times(AtLeast(2)); |
| 54 probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps, | 54 probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps, |
| 55 kMaxBitrateBps); | 55 kMaxBitrateBps); |
| 56 clock_.AdvanceTimeMilliseconds(25); | 56 // Long enough to time out exponential probing. |
| 57 clock_.AdvanceTimeMilliseconds(5000); | |
|
stefan-webrtc
2016/09/16 07:31:01
Make 5000 a constant of ProbeController.
Irfan
2016/09/16 16:26:28
Done.
| |
| 58 probe_controller_->SetEstimatedBitrate(kStartBitrateBps); | |
| 57 | 59 |
| 58 probe_controller_->SetEstimatedBitrate(kStartBitrateBps); | |
| 59 EXPECT_CALL(pacer_, CreateProbeCluster(kMaxBitrateBps + 100, _)); | 60 EXPECT_CALL(pacer_, CreateProbeCluster(kMaxBitrateBps + 100, _)); |
| 60 probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps, | 61 probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps, |
| 61 kMaxBitrateBps + 100); | 62 kMaxBitrateBps + 100); |
| 62 } | 63 } |
| 63 | 64 |
| 64 TEST_F(ProbeControllerTest, TestExponentialProbing) { | 65 TEST_F(ProbeControllerTest, TestExponentialProbing) { |
| 65 probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps, | 66 probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps, |
| 66 kMaxBitrateBps); | 67 kMaxBitrateBps); |
| 67 EXPECT_CALL(pacer_, CreateProbeCluster(2 * 1800, _)); | 68 EXPECT_CALL(pacer_, CreateProbeCluster(2 * 1800, _)); |
| 68 probe_controller_->SetEstimatedBitrate(1800); | 69 probe_controller_->SetEstimatedBitrate(1800); |
| 69 } | 70 } |
| 70 | 71 |
| 71 TEST_F(ProbeControllerTest, TestExponentialProbingTimeout) { | 72 TEST_F(ProbeControllerTest, TestExponentialProbingTimeout) { |
| 72 probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps, | 73 probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps, |
| 73 kMaxBitrateBps); | 74 kMaxBitrateBps); |
| 74 | 75 |
| 75 // Advance far enough to cause a time out in waiting for probing result. | 76 // Advance far enough to cause a time out in waiting for probing result. |
| 76 clock_.AdvanceTimeMilliseconds(5000); | 77 clock_.AdvanceTimeMilliseconds(5000); |
|
stefan-webrtc
2016/09/16 07:31:01
Use the constant here too
Irfan
2016/09/16 16:26:28
Done.
| |
| 77 EXPECT_CALL(pacer_, CreateProbeCluster(2 * 1800, _)).Times(0); | 78 EXPECT_CALL(pacer_, CreateProbeCluster(2 * 1800, _)).Times(0); |
| 78 probe_controller_->SetEstimatedBitrate(1800); | 79 probe_controller_->SetEstimatedBitrate(1800); |
| 79 } | 80 } |
| 80 | 81 |
| 81 } // namespace test | 82 } // namespace test |
| 82 } // namespace webrtc | 83 } // namespace webrtc |
| OLD | NEW |