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 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1290 bitrate.AddTargetBitrate(1, 1, expected_allocation.GetBitrate(1, 1) / 1000); | 1290 bitrate.AddTargetBitrate(1, 1, expected_allocation.GetBitrate(1, 1) / 1000); |
1291 | 1291 |
1292 rtcp::ExtendedReports xr; | 1292 rtcp::ExtendedReports xr; |
1293 xr.SetTargetBitrate(bitrate); | 1293 xr.SetTargetBitrate(bitrate); |
1294 | 1294 |
1295 EXPECT_CALL(bitrate_allocation_observer_, | 1295 EXPECT_CALL(bitrate_allocation_observer_, |
1296 OnBitrateAllocationUpdated(expected_allocation)); | 1296 OnBitrateAllocationUpdated(expected_allocation)); |
1297 InjectRtcpPacket(xr); | 1297 InjectRtcpPacket(xr); |
1298 } | 1298 } |
1299 | 1299 |
| 1300 TEST_F(RtcpReceiverTest, HandlesIncorrectTargetBitrate) { |
| 1301 BitrateAllocation expected_allocation; |
| 1302 expected_allocation.SetBitrate(0, 0, 10000); |
| 1303 |
| 1304 rtcp::TargetBitrate bitrate; |
| 1305 bitrate.AddTargetBitrate(0, 0, expected_allocation.GetBitrate(0, 0) / 1000); |
| 1306 bitrate.AddTargetBitrate(0, kMaxTemporalStreams, 20000); |
| 1307 bitrate.AddTargetBitrate(kMaxSpatialLayers, 0, 40000); |
| 1308 |
| 1309 rtcp::ExtendedReports xr; |
| 1310 xr.SetTargetBitrate(bitrate); |
| 1311 |
| 1312 EXPECT_CALL(bitrate_allocation_observer_, |
| 1313 OnBitrateAllocationUpdated(expected_allocation)); |
| 1314 InjectRtcpPacket(xr); |
| 1315 } |
| 1316 |
1300 } // namespace webrtc | 1317 } // namespace webrtc |
OLD | NEW |