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

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

Issue 3000373002: Verify sender ssrc when receiving rtcp target bitrate (Closed)
Patch Set: Set sender ssrc on other unit test as well Created 3 years, 4 months 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 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 1218
1219 rtcp::TargetBitrate bitrate; 1219 rtcp::TargetBitrate bitrate;
1220 bitrate.AddTargetBitrate(0, 0, expected_allocation.GetBitrate(0, 0) / 1000); 1220 bitrate.AddTargetBitrate(0, 0, expected_allocation.GetBitrate(0, 0) / 1000);
1221 bitrate.AddTargetBitrate(0, 1, expected_allocation.GetBitrate(0, 1) / 1000); 1221 bitrate.AddTargetBitrate(0, 1, expected_allocation.GetBitrate(0, 1) / 1000);
1222 bitrate.AddTargetBitrate(1, 0, expected_allocation.GetBitrate(1, 0) / 1000); 1222 bitrate.AddTargetBitrate(1, 0, expected_allocation.GetBitrate(1, 0) / 1000);
1223 bitrate.AddTargetBitrate(1, 1, expected_allocation.GetBitrate(1, 1) / 1000); 1223 bitrate.AddTargetBitrate(1, 1, expected_allocation.GetBitrate(1, 1) / 1000);
1224 1224
1225 rtcp::ExtendedReports xr; 1225 rtcp::ExtendedReports xr;
1226 xr.SetTargetBitrate(bitrate); 1226 xr.SetTargetBitrate(bitrate);
1227 1227
1228 // Wrong sender ssrc, target bitrate should be discarded.
1229 xr.SetSenderSsrc(kSenderSsrc + 1);
1230 EXPECT_CALL(bitrate_allocation_observer_,
1231 OnBitrateAllocationUpdated(expected_allocation))
1232 .Times(0);
1233 InjectRtcpPacket(xr);
1234
1235 // Set correct ssrc, callback should be called once.
1236 xr.SetSenderSsrc(kSenderSsrc);
1228 EXPECT_CALL(bitrate_allocation_observer_, 1237 EXPECT_CALL(bitrate_allocation_observer_,
1229 OnBitrateAllocationUpdated(expected_allocation)); 1238 OnBitrateAllocationUpdated(expected_allocation));
1230 InjectRtcpPacket(xr); 1239 InjectRtcpPacket(xr);
1231 } 1240 }
1232 1241
1233 TEST_F(RtcpReceiverTest, HandlesIncorrectTargetBitrate) { 1242 TEST_F(RtcpReceiverTest, HandlesIncorrectTargetBitrate) {
1234 BitrateAllocation expected_allocation; 1243 BitrateAllocation expected_allocation;
1235 expected_allocation.SetBitrate(0, 0, 10000); 1244 expected_allocation.SetBitrate(0, 0, 10000);
1236 1245
1237 rtcp::TargetBitrate bitrate; 1246 rtcp::TargetBitrate bitrate;
1238 bitrate.AddTargetBitrate(0, 0, expected_allocation.GetBitrate(0, 0) / 1000); 1247 bitrate.AddTargetBitrate(0, 0, expected_allocation.GetBitrate(0, 0) / 1000);
1239 bitrate.AddTargetBitrate(0, kMaxTemporalStreams, 20000); 1248 bitrate.AddTargetBitrate(0, kMaxTemporalStreams, 20000);
1240 bitrate.AddTargetBitrate(kMaxSpatialLayers, 0, 40000); 1249 bitrate.AddTargetBitrate(kMaxSpatialLayers, 0, 40000);
1241 1250
1242 rtcp::ExtendedReports xr; 1251 rtcp::ExtendedReports xr;
1243 xr.SetTargetBitrate(bitrate); 1252 xr.SetTargetBitrate(bitrate);
1253 xr.SetSenderSsrc(kSenderSsrc);
1244 1254
1245 EXPECT_CALL(bitrate_allocation_observer_, 1255 EXPECT_CALL(bitrate_allocation_observer_,
1246 OnBitrateAllocationUpdated(expected_allocation)); 1256 OnBitrateAllocationUpdated(expected_allocation));
1247 InjectRtcpPacket(xr); 1257 InjectRtcpPacket(xr);
1248 } 1258 }
1249 1259
1250 } // namespace webrtc 1260 } // 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