Index: webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc |
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc |
index 16300895027e22e86792834df7816876d8737bd0..1e3a7a23879511af8abaa7fff5cbf07511dce69e 100644 |
--- a/webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc |
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc |
@@ -1297,4 +1297,21 @@ TEST_F(RtcpReceiverTest, ReceivesTargetBitrate) { |
InjectRtcpPacket(xr); |
} |
+TEST_F(RtcpReceiverTest, HandlesIncorrectTargetBitrate) { |
+ BitrateAllocation expected_allocation; |
+ expected_allocation.SetBitrate(0, 0, 10000); |
+ |
+ rtcp::TargetBitrate bitrate; |
+ bitrate.AddTargetBitrate(0, 0, expected_allocation.GetBitrate(0, 0) / 1000); |
+ bitrate.AddTargetBitrate(0, kMaxTemporalStreams, 20000); |
+ bitrate.AddTargetBitrate(kMaxSpatialLayers, 0, 40000); |
+ |
+ rtcp::ExtendedReports xr; |
+ xr.SetTargetBitrate(bitrate); |
+ |
+ EXPECT_CALL(bitrate_allocation_observer_, |
+ OnBitrateAllocationUpdated(expected_allocation)); |
+ InjectRtcpPacket(xr); |
+} |
+ |
} // namespace webrtc |