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

Unified Diff: webrtc/modules/rtp_rtcp/source/rtcp_sender_unittest.cc

Issue 2813693003: Ensure SetREMBStatus(false) disables sending REMB (Closed)
Patch Set: . Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_sender.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/rtcp_sender_unittest.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_sender_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtcp_sender_unittest.cc
index c79cbb7483089af234b5dbdb24a2724a1f14be6f..1d1877f7931047896ae3d4d6c58feb5faf0c1456 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_sender_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_sender_unittest.cc
@@ -498,11 +498,33 @@ TEST_F(RtcpSenderTest, SendNack) {
}
TEST_F(RtcpSenderTest, RembStatus) {
+ const uint64_t kBitrate = 261011;
+ const std::vector<uint32_t> kSsrcs = {kRemoteSsrc, kRemoteSsrc + 1};
+ rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize);
+
EXPECT_FALSE(rtcp_sender_->REMB());
+ rtcp_sender_->SendRTCP(feedback_state(), kRtcpRr);
+ ASSERT_EQ(1, parser()->receiver_report()->num_packets());
+ EXPECT_EQ(0, parser()->remb()->num_packets());
+
rtcp_sender_->SetREMBStatus(true);
EXPECT_TRUE(rtcp_sender_->REMB());
+ rtcp_sender_->SetREMBData(kBitrate, kSsrcs);
+ rtcp_sender_->SendRTCP(feedback_state(), kRtcpRr);
+ ASSERT_EQ(2, parser()->receiver_report()->num_packets());
+ EXPECT_EQ(1, parser()->remb()->num_packets());
+
+ // Sending another report sends remb again, even if no new remb data was set.
+ rtcp_sender_->SendRTCP(feedback_state(), kRtcpRr);
+ ASSERT_EQ(3, parser()->receiver_report()->num_packets());
+ EXPECT_EQ(2, parser()->remb()->num_packets());
+
+ // Turn off remb. rtcp_sender no longer should send it.
rtcp_sender_->SetREMBStatus(false);
EXPECT_FALSE(rtcp_sender_->REMB());
+ rtcp_sender_->SendRTCP(feedback_state(), kRtcpRr);
+ ASSERT_EQ(4, parser()->receiver_report()->num_packets());
+ EXPECT_EQ(2, parser()->remb()->num_packets());
}
TEST_F(RtcpSenderTest, SendRemb) {
« 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