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

Unified Diff: webrtc/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: Rebase. Created 4 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/webrtc/webrtcvideoengine2.cc ('k') | webrtc/media/webrtc/webrtcvoiceengine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/webrtc/webrtcvideoengine2_unittest.cc
diff --git a/webrtc/media/webrtc/webrtcvideoengine2_unittest.cc b/webrtc/media/webrtc/webrtcvideoengine2_unittest.cc
index 7a7c81535c5d4b3d7bb0b472e12248e1d7c1e2b2..0ff3b72fd142c49a94a3a4a67caf2229d2773bb5 100644
--- a/webrtc/media/webrtc/webrtcvideoengine2_unittest.cc
+++ b/webrtc/media/webrtc/webrtcvideoengine2_unittest.cc
@@ -300,7 +300,9 @@ TEST_F(WebRtcVideoEngine2Test, CVOSetHeaderExtensionAfterCapturer) {
TEST_F(WebRtcVideoEngine2Test, SetSendFailsBeforeSettingCodecs) {
engine_.Init();
rtc::scoped_ptr<VideoMediaChannel> channel(
- engine_.CreateChannel(call_.get(), cricket::VideoOptions()));
+ engine_.CreateChannel(call_.get(),
+ cricket::MediaChannelOptions(),
+ cricket::VideoOptions()));
EXPECT_TRUE(channel->AddSendStream(StreamParams::CreateLegacy(123)));
@@ -313,7 +315,9 @@ TEST_F(WebRtcVideoEngine2Test, SetSendFailsBeforeSettingCodecs) {
TEST_F(WebRtcVideoEngine2Test, GetStatsWithoutSendCodecsSetDoesNotCrash) {
engine_.Init();
rtc::scoped_ptr<VideoMediaChannel> channel(
- engine_.CreateChannel(call_.get(), cricket::VideoOptions()));
+ engine_.CreateChannel(call_.get(),
+ cricket::MediaChannelOptions(),
+ cricket::VideoOptions()));
EXPECT_TRUE(channel->AddSendStream(StreamParams::CreateLegacy(123)));
VideoMediaInfo info;
channel->GetStats(&info);
@@ -492,7 +496,9 @@ VideoMediaChannel* WebRtcVideoEngine2Test::SetUpForExternalEncoderFactory(
engine_.Init();
VideoMediaChannel* channel =
- engine_.CreateChannel(call_.get(), cricket::VideoOptions());
+ engine_.CreateChannel(call_.get(),
+ cricket::MediaChannelOptions(),
+ cricket::VideoOptions());
cricket::VideoSendParameters parameters;
parameters.codecs = codecs;
EXPECT_TRUE(channel->SetSendParameters(parameters));
@@ -507,7 +513,9 @@ VideoMediaChannel* WebRtcVideoEngine2Test::SetUpForExternalDecoderFactory(
engine_.Init();
VideoMediaChannel* channel =
- engine_.CreateChannel(call_.get(), cricket::VideoOptions());
+ engine_.CreateChannel(call_.get(),
+ cricket::MediaChannelOptions(),
+ cricket::VideoOptions());
cricket::VideoRecvParameters parameters;
parameters.codecs = codecs;
EXPECT_TRUE(channel->SetRecvParameters(parameters));
@@ -827,7 +835,9 @@ class WebRtcVideoChannel2Test : public WebRtcVideoEngine2Test {
fake_call_.reset(new FakeCall(webrtc::Call::Config()));
engine_.Init();
channel_.reset(
- engine_.CreateChannel(fake_call_.get(), cricket::VideoOptions()));
+ engine_.CreateChannel(fake_call_.get(),
+ cricket::MediaChannelOptions(),
+ cricket::VideoOptions()));
last_ssrc_ = 123;
send_parameters_.codecs = engine_.codecs();
recv_parameters_.codecs = engine_.codecs();
@@ -2245,21 +2255,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());
+ // Default value when DSCP is disabled should be DSCP_DEFAULT.
+ 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
@@ -2920,7 +2934,9 @@ 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;
}
« no previous file with comments | « webrtc/media/webrtc/webrtcvideoengine2.cc ('k') | webrtc/media/webrtc/webrtcvoiceengine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698