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

Unified Diff: webrtc/pc/mediasession_unittest.cc

Issue 1813763005: Updated structures and functions for setting the max bitrate limit to take rtc::Optional<int> Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Code review feedback Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/pc/mediasession.h ('k') | webrtc/video/screenshare_loopback.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/mediasession_unittest.cc
diff --git a/webrtc/pc/mediasession_unittest.cc b/webrtc/pc/mediasession_unittest.cc
index 6ea7aeb8ab93f0b317e3b323acb88b9f39b15268..4dc0de79f424462c5ba36bb17b83c1e79002bc8e 100644
--- a/webrtc/pc/mediasession_unittest.cc
+++ b/webrtc/pc/mediasession_unittest.cc
@@ -59,7 +59,6 @@ using cricket::GetFirstDataContent;
using cricket::GetFirstAudioContentDescription;
using cricket::GetFirstVideoContentDescription;
using cricket::GetFirstDataContentDescription;
-using cricket::kAutoBandwidth;
using cricket::AudioCodec;
using cricket::VideoCodec;
using cricket::DataCodec;
@@ -477,7 +476,8 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateAudioOffer) {
EXPECT_EQ(MEDIA_TYPE_AUDIO, acd->type());
EXPECT_EQ(f1_.audio_codecs(), acd->codecs());
EXPECT_NE(0U, acd->first_ssrc()); // a random nonzero ssrc
- EXPECT_EQ(kAutoBandwidth, acd->bandwidth()); // default bandwidth (auto)
+ EXPECT_EQ(rtc::Optional<int>(),
+ acd->bandwidth()); // default bandwidth (auto)
EXPECT_TRUE(acd->rtcp_mux()); // rtcp-mux defaults on
ASSERT_CRYPTO(acd, 2U, CS_AES_CM_128_HMAC_SHA1_32);
EXPECT_EQ(std::string(cricket::kMediaProtocolSavpf), acd->protocol());
@@ -503,14 +503,16 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateVideoOffer) {
EXPECT_EQ(MEDIA_TYPE_AUDIO, acd->type());
EXPECT_EQ(f1_.audio_codecs(), acd->codecs());
EXPECT_NE(0U, acd->first_ssrc()); // a random nonzero ssrc
- EXPECT_EQ(kAutoBandwidth, acd->bandwidth()); // default bandwidth (auto)
+ EXPECT_EQ(rtc::Optional<int>(),
+ acd->bandwidth()); // default bandwidth (auto)
EXPECT_TRUE(acd->rtcp_mux()); // rtcp-mux defaults on
ASSERT_CRYPTO(acd, 2U, CS_AES_CM_128_HMAC_SHA1_32);
EXPECT_EQ(std::string(cricket::kMediaProtocolSavpf), acd->protocol());
EXPECT_EQ(MEDIA_TYPE_VIDEO, vcd->type());
EXPECT_EQ(f1_.video_codecs(), vcd->codecs());
EXPECT_NE(0U, vcd->first_ssrc()); // a random nonzero ssrc
- EXPECT_EQ(kAutoBandwidth, vcd->bandwidth()); // default bandwidth (auto)
+ EXPECT_EQ(rtc::Optional<int>(),
+ vcd->bandwidth()); // default bandwidth (auto)
EXPECT_TRUE(vcd->rtcp_mux()); // rtcp-mux defaults on
ASSERT_CRYPTO(vcd, 1U, CS_AES_CM_128_HMAC_SHA1_80);
EXPECT_EQ(std::string(cricket::kMediaProtocolSavpf), vcd->protocol());
@@ -610,15 +612,17 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateRtpDataOffer) {
EXPECT_EQ(MEDIA_TYPE_AUDIO, acd->type());
EXPECT_EQ(f1_.audio_codecs(), acd->codecs());
EXPECT_NE(0U, acd->first_ssrc()); // a random nonzero ssrc
- EXPECT_EQ(kAutoBandwidth, acd->bandwidth()); // default bandwidth (auto)
+ EXPECT_EQ(rtc::Optional<int>(),
+ acd->bandwidth()); // default bandwidth (auto)
EXPECT_TRUE(acd->rtcp_mux()); // rtcp-mux defaults on
ASSERT_CRYPTO(acd, 2U, CS_AES_CM_128_HMAC_SHA1_32);
EXPECT_EQ(std::string(cricket::kMediaProtocolSavpf), acd->protocol());
EXPECT_EQ(MEDIA_TYPE_DATA, dcd->type());
EXPECT_EQ(f1_.data_codecs(), dcd->codecs());
EXPECT_NE(0U, dcd->first_ssrc()); // a random nonzero ssrc
+ EXPECT_TRUE(dcd->bandwidth());
EXPECT_EQ(cricket::kDataMaxBandwidth,
- dcd->bandwidth()); // default bandwidth (auto)
+ *dcd->bandwidth()); // default bandwidth (auto)
EXPECT_TRUE(dcd->rtcp_mux()); // rtcp-mux defaults on
ASSERT_CRYPTO(dcd, 1U, CS_AES_CM_128_HMAC_SHA1_80);
EXPECT_EQ(std::string(cricket::kMediaProtocolSavpf), dcd->protocol());
@@ -760,9 +764,9 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateAudioAnswer) {
static_cast<const AudioContentDescription*>(ac->description);
EXPECT_EQ(MEDIA_TYPE_AUDIO, acd->type());
EXPECT_EQ(MAKE_VECTOR(kAudioCodecsAnswer), acd->codecs());
- EXPECT_NE(0U, acd->first_ssrc()); // a random nonzero ssrc
- EXPECT_EQ(kAutoBandwidth, acd->bandwidth()); // negotiated auto bw
- EXPECT_TRUE(acd->rtcp_mux()); // negotiated rtcp-mux
+ EXPECT_NE(0U, acd->first_ssrc()); // a random nonzero ssrc
+ EXPECT_EQ(rtc::Optional<int>(), acd->bandwidth()); // negotiated auto bw
+ EXPECT_TRUE(acd->rtcp_mux()); // negotiated rtcp-mux
ASSERT_CRYPTO(acd, 1U, CS_AES_CM_128_HMAC_SHA1_32);
EXPECT_EQ(std::string(cricket::kMediaProtocolSavpf), acd->protocol());
}
@@ -789,9 +793,9 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateVideoAnswer) {
static_cast<const VideoContentDescription*>(vc->description);
EXPECT_EQ(MEDIA_TYPE_AUDIO, acd->type());
EXPECT_EQ(MAKE_VECTOR(kAudioCodecsAnswer), acd->codecs());
- EXPECT_EQ(kAutoBandwidth, acd->bandwidth()); // negotiated auto bw
- EXPECT_NE(0U, acd->first_ssrc()); // a random nonzero ssrc
- EXPECT_TRUE(acd->rtcp_mux()); // negotiated rtcp-mux
+ EXPECT_EQ(rtc::Optional<int>(), acd->bandwidth()); // negotiated auto bw
+ EXPECT_NE(0U, acd->first_ssrc()); // a random nonzero ssrc
+ EXPECT_TRUE(acd->rtcp_mux()); // negotiated rtcp-mux
ASSERT_CRYPTO(acd, 1U, CS_AES_CM_128_HMAC_SHA1_32);
EXPECT_EQ(MEDIA_TYPE_VIDEO, vcd->type());
EXPECT_EQ(MAKE_VECTOR(kVideoCodecsAnswer), vcd->codecs());
@@ -822,9 +826,9 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateDataAnswer) {
static_cast<const DataContentDescription*>(vc->description);
EXPECT_EQ(MEDIA_TYPE_AUDIO, acd->type());
EXPECT_EQ(MAKE_VECTOR(kAudioCodecsAnswer), acd->codecs());
- EXPECT_EQ(kAutoBandwidth, acd->bandwidth()); // negotiated auto bw
- EXPECT_NE(0U, acd->first_ssrc()); // a random nonzero ssrc
- EXPECT_TRUE(acd->rtcp_mux()); // negotiated rtcp-mux
+ EXPECT_EQ(rtc::Optional<int>(), acd->bandwidth()); // negotiated auto bw
+ EXPECT_NE(0U, acd->first_ssrc()); // a random nonzero ssrc
+ EXPECT_TRUE(acd->rtcp_mux()); // negotiated rtcp-mux
ASSERT_CRYPTO(acd, 1U, CS_AES_CM_128_HMAC_SHA1_32);
EXPECT_EQ(MEDIA_TYPE_DATA, vcd->type());
EXPECT_EQ(MAKE_VECTOR(kDataCodecsAnswer), vcd->codecs());
@@ -1232,7 +1236,8 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateMultiStreamVideoOffer) {
ASSERT_EQ(1U, audio_streams[1].ssrcs.size());
EXPECT_NE(0U, audio_streams[1].ssrcs[0]);
- EXPECT_EQ(kAutoBandwidth, acd->bandwidth()); // default bandwidth (auto)
+ EXPECT_EQ(rtc::Optional<int>(),
+ acd->bandwidth()); // default bandwidth (auto)
EXPECT_TRUE(acd->rtcp_mux()); // rtcp-mux defaults on
ASSERT_CRYPTO(acd, 2U, CS_AES_CM_128_HMAC_SHA1_32);
@@ -1244,7 +1249,8 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateMultiStreamVideoOffer) {
ASSERT_EQ(1U, video_streams.size());
EXPECT_EQ(video_streams[0].cname, audio_streams[0].cname);
EXPECT_EQ(kVideoTrack1, video_streams[0].id);
- EXPECT_EQ(kAutoBandwidth, vcd->bandwidth()); // default bandwidth (auto)
+ EXPECT_EQ(rtc::Optional<int>(),
+ vcd->bandwidth()); // default bandwidth (auto)
EXPECT_TRUE(vcd->rtcp_mux()); // rtcp-mux defaults on
EXPECT_EQ(MEDIA_TYPE_DATA, dcd->type());
@@ -1261,8 +1267,9 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateMultiStreamVideoOffer) {
ASSERT_EQ(1U, data_streams[1].ssrcs.size());
EXPECT_NE(0U, data_streams[1].ssrcs[0]);
+ EXPECT_TRUE(dcd->bandwidth());
EXPECT_EQ(cricket::kDataMaxBandwidth,
- dcd->bandwidth()); // default bandwidth (auto)
+ *dcd->bandwidth()); // default bandwidth (auto)
EXPECT_TRUE(dcd->rtcp_mux()); // rtcp-mux defaults on
ASSERT_CRYPTO(dcd, 1U, CS_AES_CM_128_HMAC_SHA1_80);
@@ -1404,7 +1411,8 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateMultiStreamVideoAnswer) {
ASSERT_EQ(1U, audio_streams[1].ssrcs.size());
EXPECT_NE(0U, audio_streams[1].ssrcs[0]);
- EXPECT_EQ(kAutoBandwidth, acd->bandwidth()); // default bandwidth (auto)
+ EXPECT_EQ(rtc::Optional<int>(),
+ acd->bandwidth()); // default bandwidth (auto)
EXPECT_TRUE(acd->rtcp_mux()); // rtcp-mux defaults on
EXPECT_EQ(MEDIA_TYPE_VIDEO, vcd->type());
@@ -1414,8 +1422,8 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateMultiStreamVideoAnswer) {
ASSERT_EQ(1U, video_streams.size());
EXPECT_EQ(video_streams[0].cname, audio_streams[0].cname);
EXPECT_EQ(kVideoTrack1, video_streams[0].id);
- EXPECT_EQ(kAutoBandwidth, vcd->bandwidth()); // default bandwidth (auto)
- EXPECT_TRUE(vcd->rtcp_mux()); // rtcp-mux defaults on
+ EXPECT_EQ(rtc::Optional<int>(), vcd->bandwidth()); // default bandwidth
+ EXPECT_TRUE(vcd->rtcp_mux()); // rtcp-mux defaults on
EXPECT_EQ(MEDIA_TYPE_DATA, dcd->type());
EXPECT_EQ(MAKE_VECTOR(kDataCodecsAnswer), dcd->codecs());
@@ -1430,9 +1438,10 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateMultiStreamVideoAnswer) {
ASSERT_EQ(1U, data_streams[1].ssrcs.size());
EXPECT_NE(0U, data_streams[1].ssrcs[0]);
+ EXPECT_TRUE(dcd->bandwidth());
EXPECT_EQ(cricket::kDataMaxBandwidth,
- dcd->bandwidth()); // default bandwidth (auto)
- EXPECT_TRUE(dcd->rtcp_mux()); // rtcp-mux defaults on
+ *dcd->bandwidth()); // default bandwidth (auto)
+ EXPECT_TRUE(dcd->rtcp_mux()); // rtcp-mux defaults on
// Update the answer. Add a new video track that is not synched to the
// other traacks and remove 1 audio track.
« no previous file with comments | « webrtc/pc/mediasession.h ('k') | webrtc/video/screenshare_loopback.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698