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

Unified Diff: talk/media/webrtc/webrtcvideoengine2_unittest.cc

Issue 1646253004: Split out dscp option from VideoOptions to new struct MediaChannelOptions. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rename DscpValue --> MediaTypeDscpValue. Created 4 years, 11 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
Index: talk/media/webrtc/webrtcvideoengine2_unittest.cc
diff --git a/talk/media/webrtc/webrtcvideoengine2_unittest.cc b/talk/media/webrtc/webrtcvideoengine2_unittest.cc
index ed31c8a9baeeef388a0d55c2332fb5a11ccd924d..0c4a042b4d25a46dcd2415bc44790f45b0add7e0 100644
--- a/talk/media/webrtc/webrtcvideoengine2_unittest.cc
+++ b/talk/media/webrtc/webrtcvideoengine2_unittest.cc
@@ -343,8 +343,8 @@ TEST_F(WebRtcVideoEngine2Test, CVOSetHeaderExtensionAfterCapturer) {
TEST_F(WebRtcVideoEngine2Test, SetSendFailsBeforeSettingCodecs) {
engine_.Init();
- rtc::scoped_ptr<VideoMediaChannel> channel(
- engine_.CreateChannel(call_.get(), cricket::VideoOptions()));
+ rtc::scoped_ptr<VideoMediaChannel> channel(engine_.CreateChannel(
+ call_.get(), MediaChannelOptions(), VideoOptions()));
EXPECT_TRUE(channel->AddSendStream(StreamParams::CreateLegacy(123)));
@@ -356,8 +356,8 @@ TEST_F(WebRtcVideoEngine2Test, SetSendFailsBeforeSettingCodecs) {
TEST_F(WebRtcVideoEngine2Test, GetStatsWithoutSendCodecsSetDoesNotCrash) {
engine_.Init();
- rtc::scoped_ptr<VideoMediaChannel> channel(
- engine_.CreateChannel(call_.get(), cricket::VideoOptions()));
+ rtc::scoped_ptr<VideoMediaChannel> channel(engine_.CreateChannel(
+ call_.get(), MediaChannelOptions(), VideoOptions()));
EXPECT_TRUE(channel->AddSendStream(StreamParams::CreateLegacy(123)));
VideoMediaInfo info;
channel->GetStats(&info);
@@ -536,7 +536,7 @@ VideoMediaChannel* WebRtcVideoEngine2Test::SetUpForExternalEncoderFactory(
engine_.Init();
VideoMediaChannel* channel =
- engine_.CreateChannel(call_.get(), cricket::VideoOptions());
+ engine_.CreateChannel(call_.get(), MediaChannelOptions(), VideoOptions());
cricket::VideoSendParameters parameters;
parameters.codecs = codecs;
EXPECT_TRUE(channel->SetSendParameters(parameters));
@@ -551,7 +551,7 @@ VideoMediaChannel* WebRtcVideoEngine2Test::SetUpForExternalDecoderFactory(
engine_.Init();
VideoMediaChannel* channel =
- engine_.CreateChannel(call_.get(), cricket::VideoOptions());
+ engine_.CreateChannel(call_.get(), MediaChannelOptions(), VideoOptions());
cricket::VideoRecvParameters parameters;
parameters.codecs = codecs;
EXPECT_TRUE(channel->SetRecvParameters(parameters));
@@ -895,8 +895,8 @@ class WebRtcVideoChannel2Test : public WebRtcVideoEngine2Test {
void SetUp() override {
fake_call_.reset(new FakeCall(webrtc::Call::Config()));
engine_.Init();
- channel_.reset(
- engine_.CreateChannel(fake_call_.get(), cricket::VideoOptions()));
+ channel_.reset(engine_.CreateChannel(
+ fake_call_.get(), MediaChannelOptions(), VideoOptions()));
last_ssrc_ = 123;
send_parameters_.codecs = engine_.codecs();
recv_parameters_.codecs = engine_.codecs();
@@ -2378,21 +2378,25 @@ TEST_F(WebRtcVideoChannel2Test, SetSend) {
TEST_F(WebRtcVideoChannel2Test, TestSetDscpOptions) {
rtc::scoped_ptr<cricket::FakeNetworkInterface> network_interface(
new cricket::FakeNetworkInterface);
- channel_->SetInterface(network_interface.get());
- cricket::VideoSendParameters parameters = send_parameters_;
- EXPECT_TRUE(channel_->SetSendParameters(parameters));
- EXPECT_EQ(rtc::DSCP_NO_CHANGE, network_interface->dscp());
- parameters.options.dscp = rtc::Optional<bool>(true);
- EXPECT_TRUE(channel_->SetSendParameters(parameters));
- EXPECT_EQ(rtc::DSCP_AF41, network_interface->dscp());
- // Verify previous value is not modified if dscp option is not set.
- cricket::VideoSendParameters parameters1 = send_parameters_;
- EXPECT_TRUE(channel_->SetSendParameters(parameters1));
+ MediaChannelOptions options;
+ rtc::scoped_ptr<VideoMediaChannel> channel;
+
+ channel.reset(engine_.CreateChannel(call_.get(), options, VideoOptions()));
+ channel->SetInterface(network_interface.get());
+ // Current implementation always sets the DiffServCodePoint.
pbos-webrtc 2016/02/01 14:44:38 // Default value when DSCP is disabled should be D
nisse-webrtc 2016/02/02 11:32:50 Done.
+ EXPECT_EQ(rtc::DSCP_DEFAULT, network_interface->dscp());
+
+ options.enable_dscp = true;
+ channel.reset(engine_.CreateChannel(call_.get(), options, VideoOptions()));
+ channel->SetInterface(network_interface.get());
EXPECT_EQ(rtc::DSCP_AF41, network_interface->dscp());
- parameters1.options.dscp = rtc::Optional<bool>(false);
- EXPECT_TRUE(channel_->SetSendParameters(parameters1));
+
+ // Verify that setting the option to false resets the
+ // DiffServCodePoint.
+ options.enable_dscp = false;
+ channel.reset(engine_.CreateChannel(call_.get(), options, VideoOptions()));
+ channel->SetInterface(network_interface.get());
EXPECT_EQ(rtc::DSCP_DEFAULT, network_interface->dscp());
- channel_->SetInterface(NULL);
}
// This test verifies that the RTCP reduced size mode is properly applied to
@@ -3200,7 +3204,8 @@ class WebRtcVideoChannel2SimulcastTest : public testing::Test {
void SetUp() override {
engine_.Init();
- channel_.reset(engine_.CreateChannel(&fake_call_, VideoOptions()));
+ channel_.reset(engine_.CreateChannel(&fake_call_, MediaChannelOptions(),
+ VideoOptions()));
last_ssrc_ = 123;
}

Powered by Google App Engine
This is Rietveld 408576698