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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 EXPECT_EQ(255189, bitrate_observer_.last_bitrate_); | 145 EXPECT_EQ(255189, bitrate_observer_.last_bitrate_); |
146 time_ms += 1000; | 146 time_ms += 1000; |
147 | 147 |
148 report_blocks.clear(); | 148 report_blocks.clear(); |
149 report_blocks.push_back(CreateReportBlock(1, 2, 0, 81)); | 149 report_blocks.push_back(CreateReportBlock(1, 2, 0, 81)); |
150 bandwidth_observer_->OnReceivedRtcpReceiverReport(report_blocks, 50, time_ms); | 150 bandwidth_observer_->OnReceivedRtcpReceiverReport(report_blocks, 50, time_ms); |
151 EXPECT_EQ(276604, bitrate_observer_.last_bitrate_); | 151 EXPECT_EQ(276604, bitrate_observer_.last_bitrate_); |
152 time_ms += 1000; | 152 time_ms += 1000; |
153 | 153 |
154 report_blocks.clear(); | 154 report_blocks.clear(); |
155 report_blocks.push_back(CreateReportBlock(1, 2, 0, 801)); | 155 report_blocks.push_back(CreateReportBlock(1, 2, 0, 101)); |
156 bandwidth_observer_->OnReceivedRtcpReceiverReport(report_blocks, 50, time_ms); | 156 bandwidth_observer_->OnReceivedRtcpReceiverReport(report_blocks, 50, time_ms); |
157 EXPECT_EQ(299732, bitrate_observer_.last_bitrate_); | 157 EXPECT_EQ(299732, bitrate_observer_.last_bitrate_); |
158 time_ms += 1000; | 158 time_ms += 1000; |
159 | 159 |
160 // Reach max cap. | 160 // Reach max cap. |
161 report_blocks.clear(); | 161 report_blocks.clear(); |
162 report_blocks.push_back(CreateReportBlock(1, 2, 0, 101)); | 162 report_blocks.push_back(CreateReportBlock(1, 2, 0, 121)); |
163 bandwidth_observer_->OnReceivedRtcpReceiverReport(report_blocks, 50, time_ms); | 163 bandwidth_observer_->OnReceivedRtcpReceiverReport(report_blocks, 50, time_ms); |
164 EXPECT_EQ(300000, bitrate_observer_.last_bitrate_); | 164 EXPECT_EQ(300000, bitrate_observer_.last_bitrate_); |
165 time_ms += 1000; | 165 time_ms += 1000; |
166 | 166 |
167 report_blocks.clear(); | 167 report_blocks.clear(); |
168 report_blocks.push_back(CreateReportBlock(1, 2, 0, 141)); | 168 report_blocks.push_back(CreateReportBlock(1, 2, 0, 141)); |
169 bandwidth_observer_->OnReceivedRtcpReceiverReport(report_blocks, 50, time_ms); | 169 bandwidth_observer_->OnReceivedRtcpReceiverReport(report_blocks, 50, time_ms); |
170 EXPECT_EQ(300000, bitrate_observer_.last_bitrate_); | 170 EXPECT_EQ(300000, bitrate_observer_.last_bitrate_); |
171 | 171 |
172 // Test that a low delay-based estimate limits the combined estimate. | 172 // Test that a low delay-based estimate limits the combined estimate. |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 EXPECT_EQ(120000, bitrate_observer_.last_bitrate_); | 399 EXPECT_EQ(120000, bitrate_observer_.last_bitrate_); |
400 controller_->SetReservedBitrate(50000); | 400 controller_->SetReservedBitrate(50000); |
401 bandwidth_observer_->OnReceivedEstimatedBitrate(120000); | 401 bandwidth_observer_->OnReceivedEstimatedBitrate(120000); |
402 // Limited by min bitrate. | 402 // Limited by min bitrate. |
403 EXPECT_EQ(100000, bitrate_observer_.last_bitrate_); | 403 EXPECT_EQ(100000, bitrate_observer_.last_bitrate_); |
404 | 404 |
405 controller_->SetReservedBitrate(10000); | 405 controller_->SetReservedBitrate(10000); |
406 bandwidth_observer_->OnReceivedEstimatedBitrate(1); | 406 bandwidth_observer_->OnReceivedEstimatedBitrate(1); |
407 EXPECT_EQ(100000, bitrate_observer_.last_bitrate_); | 407 EXPECT_EQ(100000, bitrate_observer_.last_bitrate_); |
408 } | 408 } |
OLD | NEW |