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 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // to be updated. | 45 // to be updated. |
46 EXPECT_CALL(observer_, OnNetworkChanged(kInitialBitrateBps, _, _)); | 46 EXPECT_CALL(observer_, OnNetworkChanged(kInitialBitrateBps, _, _)); |
47 EXPECT_CALL(*pacer_, SetEstimatedBitrate(kInitialBitrateBps)); | 47 EXPECT_CALL(*pacer_, SetEstimatedBitrate(kInitialBitrateBps)); |
48 controller_->SetBweBitrates(0, kInitialBitrateBps, 5 * kInitialBitrateBps); | 48 controller_->SetBweBitrates(0, kInitialBitrateBps, 5 * kInitialBitrateBps); |
49 } | 49 } |
50 | 50 |
51 SimulatedClock clock_; | 51 SimulatedClock clock_; |
52 StrictMock<MockCongestionObserver> observer_; | 52 StrictMock<MockCongestionObserver> observer_; |
53 NiceMock<MockPacedSender>* pacer_; | 53 NiceMock<MockPacedSender>* pacer_; |
54 NiceMock<MockRemoteBitrateObserver> remote_bitrate_observer_; | 54 NiceMock<MockRemoteBitrateObserver> remote_bitrate_observer_; |
55 MockRtcEventLog event_log_; | 55 NiceMock<MockRtcEventLog> event_log_; |
56 std::unique_ptr<RtcpBandwidthObserver> bandwidth_observer_; | 56 std::unique_ptr<RtcpBandwidthObserver> bandwidth_observer_; |
57 std::unique_ptr<CongestionController> controller_; | 57 std::unique_ptr<CongestionController> controller_; |
58 const uint32_t kInitialBitrateBps = 60000; | 58 const uint32_t kInitialBitrateBps = 60000; |
59 }; | 59 }; |
60 | 60 |
61 TEST_F(CongestionControllerTest, OnNetworkChanged) { | 61 TEST_F(CongestionControllerTest, OnNetworkChanged) { |
62 // Test no change. | 62 // Test no change. |
63 clock_.AdvanceTimeMilliseconds(25); | 63 clock_.AdvanceTimeMilliseconds(25); |
64 controller_->Process(); | 64 controller_->Process(); |
65 | 65 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 164 |
165 // Let the pacer not be full next time the controller checks. | 165 // Let the pacer not be full next time the controller checks. |
166 EXPECT_CALL(*pacer_, ExpectedQueueTimeMs()) | 166 EXPECT_CALL(*pacer_, ExpectedQueueTimeMs()) |
167 .WillOnce(Return(PacedSender::kMaxQueueLengthMs - 1)); | 167 .WillOnce(Return(PacedSender::kMaxQueueLengthMs - 1)); |
168 EXPECT_CALL(observer_, OnNetworkChanged(kInitialBitrateBps * 2, _, _)); | 168 EXPECT_CALL(observer_, OnNetworkChanged(kInitialBitrateBps * 2, _, _)); |
169 controller_->Process(); | 169 controller_->Process(); |
170 } | 170 } |
171 | 171 |
172 } // namespace test | 172 } // namespace test |
173 } // namespace webrtc | 173 } // namespace webrtc |
OLD | NEW |