Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc

Issue 2549233005: Reject XR TargetBitrate items with unsupported layer indices (Closed)
Patch Set: Addressed comments Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698