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

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

Issue 2758533002: Fix rtcp_sender to support sdes with 31 chunk (Closed)
Patch Set: +todo Created 3 years, 9 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_sender.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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 TEST_F(RtcpSenderTest, SendSdes) { 380 TEST_F(RtcpSenderTest, SendSdes) {
381 rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize); 381 rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize);
382 EXPECT_EQ(0, rtcp_sender_->SetCNAME("alice@host")); 382 EXPECT_EQ(0, rtcp_sender_->SetCNAME("alice@host"));
383 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpSdes)); 383 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpSdes));
384 EXPECT_EQ(1, parser()->sdes()->num_packets()); 384 EXPECT_EQ(1, parser()->sdes()->num_packets());
385 EXPECT_EQ(1U, parser()->sdes()->chunks().size()); 385 EXPECT_EQ(1U, parser()->sdes()->chunks().size());
386 EXPECT_EQ(kSenderSsrc, parser()->sdes()->chunks()[0].ssrc); 386 EXPECT_EQ(kSenderSsrc, parser()->sdes()->chunks()[0].ssrc);
387 EXPECT_EQ("alice@host", parser()->sdes()->chunks()[0].cname); 387 EXPECT_EQ("alice@host", parser()->sdes()->chunks()[0].cname);
388 } 388 }
389 389
390 TEST_F(RtcpSenderTest, SendSdesWithMaxChunks) {
391 rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize);
392 EXPECT_EQ(0, rtcp_sender_->SetCNAME("alice@host"));
393 const char cname[] = "smith@host";
394 for (size_t i = 0; i < 30; ++i) {
395 const uint32_t csrc = 0x1234 + i;
396 EXPECT_EQ(0, rtcp_sender_->AddMixedCNAME(csrc, cname));
397 }
398 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpSdes));
399 EXPECT_EQ(1, parser()->sdes()->num_packets());
400 EXPECT_EQ(31U, parser()->sdes()->chunks().size());
401 }
402
390 TEST_F(RtcpSenderTest, SdesIncludedInCompoundPacket) { 403 TEST_F(RtcpSenderTest, SdesIncludedInCompoundPacket) {
391 rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound); 404 rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound);
392 EXPECT_EQ(0, rtcp_sender_->SetCNAME("alice@host")); 405 EXPECT_EQ(0, rtcp_sender_->SetCNAME("alice@host"));
393 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpReport)); 406 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpReport));
394 EXPECT_EQ(1, parser()->receiver_report()->num_packets()); 407 EXPECT_EQ(1, parser()->receiver_report()->num_packets());
395 EXPECT_EQ(1, parser()->sdes()->num_packets()); 408 EXPECT_EQ(1, parser()->sdes()->num_packets());
396 EXPECT_EQ(1U, parser()->sdes()->chunks().size()); 409 EXPECT_EQ(1U, parser()->sdes()->chunks().size());
397 } 410 }
398 411
399 TEST_F(RtcpSenderTest, SendBye) { 412 TEST_F(RtcpSenderTest, SendBye) {
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 const rtcp::TargetBitrate::BitrateItem& item = bitrates[index]; 814 const rtcp::TargetBitrate::BitrateItem& item = bitrates[index];
802 EXPECT_EQ(sl, item.spatial_layer); 815 EXPECT_EQ(sl, item.spatial_layer);
803 EXPECT_EQ(tl, item.temporal_layer); 816 EXPECT_EQ(tl, item.temporal_layer);
804 EXPECT_EQ(start_bitrate_bps + (tl * 20000), 817 EXPECT_EQ(start_bitrate_bps + (tl * 20000),
805 item.target_bitrate_kbps * 1000); 818 item.target_bitrate_kbps * 1000);
806 } 819 }
807 } 820 }
808 } 821 }
809 822
810 } // namespace webrtc 823 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_sender.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698