Index: webrtc/pc/channel_unittest.cc |
diff --git a/webrtc/pc/channel_unittest.cc b/webrtc/pc/channel_unittest.cc |
index 9d20def32f2c60bf9b5b307c605497ed9961ad9e..774967a02da90d01e5f59ae317837e0e70ea8919 100644 |
--- a/webrtc/pc/channel_unittest.cc |
+++ b/webrtc/pc/channel_unittest.cc |
@@ -1849,7 +1849,7 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> { |
return channel1_->SetRemoteContent(&content, CA_OFFER, NULL); |
} |
- webrtc::RtpParameters BitrateLimitedParameters(int limit) { |
+ webrtc::RtpParameters BitrateLimitedParameters(rtc::Optional<int> limit) { |
webrtc::RtpParameters parameters; |
webrtc::RtpEncodingParameters encoding; |
encoding.max_bitrate_bps = limit; |
@@ -1858,7 +1858,7 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> { |
} |
void VerifyMaxBitrate(const webrtc::RtpParameters& parameters, |
- int expected_bitrate) { |
+ rtc::Optional<int> expected_bitrate) { |
EXPECT_EQ(1UL, parameters.encodings.size()); |
EXPECT_EQ(expected_bitrate, parameters.encodings[0].max_bitrate_bps); |
} |
@@ -1867,8 +1867,9 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> { |
CreateChannels(0, 0); |
EXPECT_TRUE( |
channel1_->SetLocalContent(&local_media_content1_, CA_OFFER, NULL)); |
- EXPECT_EQ(media_channel1_->max_bps(), -1); |
- VerifyMaxBitrate(media_channel1_->GetRtpParameters(kSsrc1), -1); |
+ EXPECT_EQ(rtc::Optional<int>(), media_channel1_->max_bps()); |
+ VerifyMaxBitrate(media_channel1_->GetRtpParameters(kSsrc1), |
+ rtc::Optional<int>()); |
} |
void CanChangeMaxBitrate() { |
@@ -1876,17 +1877,20 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> { |
EXPECT_TRUE( |
channel1_->SetLocalContent(&local_media_content1_, CA_OFFER, NULL)); |
- EXPECT_TRUE( |
- channel1_->SetRtpParameters(kSsrc1, BitrateLimitedParameters(1000))); |
- VerifyMaxBitrate(channel1_->GetRtpParameters(kSsrc1), 1000); |
- VerifyMaxBitrate(media_channel1_->GetRtpParameters(kSsrc1), 1000); |
- EXPECT_EQ(-1, media_channel1_->max_bps()); |
+ EXPECT_TRUE(channel1_->SetRtpParameters( |
+ kSsrc1, BitrateLimitedParameters(rtc::Optional<int>(1000)))); |
+ VerifyMaxBitrate(channel1_->GetRtpParameters(kSsrc1), |
+ rtc::Optional<int>(1000)); |
+ VerifyMaxBitrate(media_channel1_->GetRtpParameters(kSsrc1), |
+ rtc::Optional<int>(1000)); |
+ EXPECT_EQ(rtc::Optional<int>(), media_channel1_->max_bps()); |
- EXPECT_TRUE( |
- channel1_->SetRtpParameters(kSsrc1, BitrateLimitedParameters(-1))); |
- VerifyMaxBitrate(channel1_->GetRtpParameters(kSsrc1), -1); |
- VerifyMaxBitrate(media_channel1_->GetRtpParameters(kSsrc1), -1); |
- EXPECT_EQ(-1, media_channel1_->max_bps()); |
+ EXPECT_TRUE(channel1_->SetRtpParameters( |
+ kSsrc1, BitrateLimitedParameters(rtc::Optional<int>()))); |
+ VerifyMaxBitrate(channel1_->GetRtpParameters(kSsrc1), rtc::Optional<int>()); |
+ VerifyMaxBitrate(media_channel1_->GetRtpParameters(kSsrc1), |
+ rtc::Optional<int>()); |
+ EXPECT_EQ(rtc::Optional<int>(), media_channel1_->max_bps()); |
} |
protected: |
@@ -2369,8 +2373,8 @@ TEST_F(VoiceChannelTest, SetRtpParametersIsNotImplemented) { |
CreateChannels(0, 0); |
EXPECT_TRUE( |
channel1_->SetLocalContent(&local_media_content1_, CA_OFFER, NULL)); |
- EXPECT_FALSE( |
- channel1_->SetRtpParameters(kSsrc1, BitrateLimitedParameters(1000))); |
+ EXPECT_FALSE(channel1_->SetRtpParameters( |
+ kSsrc1, BitrateLimitedParameters(rtc::Optional<int>(1000)))); |
} |
// VideoChannelTest |