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

Unified Diff: webrtc/pc/channel_unittest.cc

Issue 2651883010: Adding C++ versions of currently spec'd "RtpParameters" structs. (Closed)
Patch Set: Update unit tests (due to switch from special-case values to rtc::Optional) Created 3 years, 10 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/media/engine/webrtcvoiceengine_unittest.cc ('k') | webrtc/pc/rtcstatscollector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/channel_unittest.cc
diff --git a/webrtc/pc/channel_unittest.cc b/webrtc/pc/channel_unittest.cc
index 57e7afb17946c6077a01c10ee72171f4783e3b82..a64fc34b318cd0c8b57859b37c9a75b70e262768 100644
--- a/webrtc/pc/channel_unittest.cc
+++ b/webrtc/pc/channel_unittest.cc
@@ -1956,7 +1956,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;
@@ -1965,7 +1965,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);
}
@@ -1975,7 +1975,8 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> {
EXPECT_TRUE(
channel1_->SetLocalContent(&local_media_content1_, CA_OFFER, NULL));
EXPECT_EQ(media_channel1_->max_bps(), -1);
- VerifyMaxBitrate(media_channel1_->GetRtpSendParameters(kSsrc1), -1);
+ VerifyMaxBitrate(media_channel1_->GetRtpSendParameters(kSsrc1),
+ rtc::Optional<int>());
}
void CanChangeMaxBitrate() {
@@ -1984,15 +1985,19 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> {
channel1_->SetLocalContent(&local_media_content1_, CA_OFFER, NULL));
EXPECT_TRUE(channel1_->SetRtpSendParameters(
- kSsrc1, BitrateLimitedParameters(1000)));
- VerifyMaxBitrate(channel1_->GetRtpSendParameters(kSsrc1), 1000);
- VerifyMaxBitrate(media_channel1_->GetRtpSendParameters(kSsrc1), 1000);
+ kSsrc1, BitrateLimitedParameters(rtc::Optional<int>(1000))));
+ VerifyMaxBitrate(channel1_->GetRtpSendParameters(kSsrc1),
+ rtc::Optional<int>(1000));
+ VerifyMaxBitrate(media_channel1_->GetRtpSendParameters(kSsrc1),
+ rtc::Optional<int>(1000));
EXPECT_EQ(-1, media_channel1_->max_bps());
- EXPECT_TRUE(
- channel1_->SetRtpSendParameters(kSsrc1, BitrateLimitedParameters(-1)));
- VerifyMaxBitrate(channel1_->GetRtpSendParameters(kSsrc1), -1);
- VerifyMaxBitrate(media_channel1_->GetRtpSendParameters(kSsrc1), -1);
+ EXPECT_TRUE(channel1_->SetRtpSendParameters(
+ kSsrc1, BitrateLimitedParameters(rtc::Optional<int>())));
+ VerifyMaxBitrate(channel1_->GetRtpSendParameters(kSsrc1),
+ rtc::Optional<int>());
+ VerifyMaxBitrate(media_channel1_->GetRtpSendParameters(kSsrc1),
+ rtc::Optional<int>());
EXPECT_EQ(-1, media_channel1_->max_bps());
}
« no previous file with comments | « webrtc/media/engine/webrtcvoiceengine_unittest.cc ('k') | webrtc/pc/rtcstatscollector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698