Index: webrtc/api/webrtcsession_unittest.cc |
diff --git a/webrtc/api/webrtcsession_unittest.cc b/webrtc/api/webrtcsession_unittest.cc |
index c0fff5251301b58a09508ef03e31f96289f9c57d..77c4854680bf141d2c1ae194f74ee0ad1b59edb2 100644 |
--- a/webrtc/api/webrtcsession_unittest.cc |
+++ b/webrtc/api/webrtcsession_unittest.cc |
@@ -3385,6 +3385,25 @@ TEST_F(WebRtcSessionTest, SetAudioPlayout) { |
EXPECT_EQ(1, volume); |
} |
+TEST_F(WebRtcSessionTest, AudioMaxSendBitrateNotImplemented) { |
+ // This test verifies that RtpParameters for audio RtpSenders cannot be |
+ // changed. |
+ // TODO(skvlad): Update the test after adding support for bitrate limiting in |
+ // WebRtcAudioSendStream. |
+ |
+ Init(); |
+ SendAudioVideoStream1(); |
+ CreateAndSetRemoteOfferAndLocalAnswer(); |
+ cricket::FakeVoiceMediaChannel* channel = media_engine_->GetVoiceChannel(0); |
+ ASSERT_TRUE(channel != NULL); |
+ uint32_t send_ssrc = channel->send_streams()[0].first_ssrc(); |
+ webrtc::RtpParameters params = session_->GetAudioRtpParameters(send_ssrc); |
+ |
+ EXPECT_EQ(0, params.encodings.size()); |
+ params.encodings.push_back(webrtc::RtpEncodingParameters()); |
+ EXPECT_FALSE(session_->SetAudioRtpParameters(send_ssrc, params)); |
+} |
+ |
TEST_F(WebRtcSessionTest, SetAudioSend) { |
Init(); |
SendAudioVideoStream1(); |
@@ -3451,6 +3470,34 @@ TEST_F(WebRtcSessionTest, SetVideoPlayout) { |
EXPECT_TRUE(channel->sinks().begin()->second == NULL); |
} |
+TEST_F(WebRtcSessionTest, SetVideoMaxSendBitrate) { |
+ Init(); |
+ SendAudioVideoStream1(); |
+ CreateAndSetRemoteOfferAndLocalAnswer(); |
+ cricket::FakeVideoMediaChannel* channel = media_engine_->GetVideoChannel(0); |
+ ASSERT_TRUE(channel != NULL); |
+ uint32_t send_ssrc = channel->send_streams()[0].first_ssrc(); |
+ EXPECT_EQ(-1, channel->max_bps()); |
+ webrtc::RtpParameters params = session_->GetVideoRtpParameters(send_ssrc); |
+ EXPECT_EQ(1, params.encodings.size()); |
+ EXPECT_EQ(-1, params.encodings[0].max_bitrate_bps); |
+ params.encodings[0].max_bitrate_bps = 1000; |
+ EXPECT_TRUE(session_->SetVideoRtpParameters(send_ssrc, params)); |
+ |
+ // Read back the parameters and verify they have been changed. |
+ params = session_->GetVideoRtpParameters(send_ssrc); |
+ EXPECT_EQ(1, params.encodings.size()); |
+ EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps); |
+ |
+ // Verify that the video channel received the new parameters. |
+ params = channel->GetRtpParameters(send_ssrc); |
+ EXPECT_EQ(1, params.encodings.size()); |
+ EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps); |
+ |
+ // Verify that the global bitrate limit has not been changed. |
+ EXPECT_EQ(-1, channel->max_bps()); |
+} |
+ |
TEST_F(WebRtcSessionTest, SetVideoSend) { |
Init(); |
SendAudioVideoStream1(); |