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

Unified Diff: talk/media/webrtc/webrtcvoiceengine_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/webrtcvoiceengine_unittest.cc
diff --git a/talk/media/webrtc/webrtcvoiceengine_unittest.cc b/talk/media/webrtc/webrtcvoiceengine_unittest.cc
index 2d272fc6d4178602884bcaeb1a5df80a9e73eb87..d892783c0696e58c32cccb56f6f4c4ac3ffc3ae3 100644
--- a/talk/media/webrtc/webrtcvoiceengine_unittest.cc
+++ b/talk/media/webrtc/webrtcvoiceengine_unittest.cc
@@ -90,7 +90,8 @@ class WebRtcVoiceEngineTestFake : public testing::Test {
if (!engine_.Init(rtc::Thread::Current())) {
return false;
}
- channel_ = engine_.CreateChannel(&call_, cricket::AudioOptions());
+ channel_ = engine_.CreateChannel(&call_, cricket::MediaChannelOptions(),
+ cricket::AudioOptions());
return (channel_ != nullptr);
}
bool SetupEngineWithRecvStream() {
@@ -150,7 +151,8 @@ class WebRtcVoiceEngineTestFake : public testing::Test {
void TestInsertDtmf(uint32_t ssrc, bool caller) {
EXPECT_TRUE(engine_.Init(rtc::Thread::Current()));
- channel_ = engine_.CreateChannel(&call_, cricket::AudioOptions());
+ channel_ = engine_.CreateChannel(&call_, cricket::MediaChannelOptions(),
+ cricket::AudioOptions());
EXPECT_TRUE(channel_ != nullptr);
if (caller) {
// If this is a caller, local description will be applied and add the
@@ -424,7 +426,8 @@ TEST_F(WebRtcVoiceEngineTestFake, StartupShutdown) {
// Tests that we can create and destroy a channel.
TEST_F(WebRtcVoiceEngineTestFake, CreateChannel) {
EXPECT_TRUE(engine_.Init(rtc::Thread::Current()));
- channel_ = engine_.CreateChannel(&call_, cricket::AudioOptions());
+ channel_ = engine_.CreateChannel(&call_, cricket::MediaChannelOptions(),
+ cricket::AudioOptions());
EXPECT_TRUE(channel_ != nullptr);
}
@@ -1676,7 +1679,8 @@ TEST_F(WebRtcVoiceEngineTestFake, SetSendCodecsCNandDTMFAsCaller) {
// Test that we set VAD and DTMF types correctly as callee.
TEST_F(WebRtcVoiceEngineTestFake, SetSendCodecsCNandDTMFAsCallee) {
EXPECT_TRUE(engine_.Init(rtc::Thread::Current()));
- channel_ = engine_.CreateChannel(&call_, cricket::AudioOptions());
+ channel_ = engine_.CreateChannel(&call_, cricket::MediaChannelOptions(),
+ cricket::AudioOptions());
EXPECT_TRUE(channel_ != nullptr);
cricket::AudioSendParameters parameters;
@@ -1793,7 +1797,8 @@ TEST_F(WebRtcVoiceEngineTestFake, SetSendCodecsREDAsCaller) {
// Test that we set up RED correctly as callee.
TEST_F(WebRtcVoiceEngineTestFake, SetSendCodecsREDAsCallee) {
EXPECT_TRUE(engine_.Init(rtc::Thread::Current()));
- channel_ = engine_.CreateChannel(&call_, cricket::AudioOptions());
+ channel_ = engine_.CreateChannel(&call_, cricket::MediaChannelOptions(),
+ cricket::AudioOptions());
EXPECT_TRUE(channel_ != nullptr);
cricket::AudioSendParameters parameters;
@@ -2303,7 +2308,8 @@ TEST_F(WebRtcVoiceEngineTestFake, SetSendSsrcWithMultipleStreams) {
// receive channel is created before the send channel.
TEST_F(WebRtcVoiceEngineTestFake, SetSendSsrcAfterCreatingReceiveChannel) {
EXPECT_TRUE(engine_.Init(rtc::Thread::Current()));
- channel_ = engine_.CreateChannel(&call_, cricket::AudioOptions());
+ channel_ = engine_.CreateChannel(&call_, cricket::MediaChannelOptions(),
+ cricket::AudioOptions());
EXPECT_TRUE(channel_->AddRecvStream(cricket::StreamParams::CreateLegacy(1)));
int receive_channel_num = voe_.GetLastChannel();
@@ -2731,11 +2737,11 @@ TEST_F(WebRtcVoiceEngineTestFake, InitDoesNotOverwriteDefaultAgcConfig) {
TEST_F(WebRtcVoiceEngineTestFake, SetOptionOverridesViaChannels) {
EXPECT_TRUE(SetupEngineWithSendStream());
rtc::scoped_ptr<cricket::WebRtcVoiceMediaChannel> channel1(
- static_cast<cricket::WebRtcVoiceMediaChannel*>(
- engine_.CreateChannel(&call_, cricket::AudioOptions())));
+ static_cast<cricket::WebRtcVoiceMediaChannel*>(engine_.CreateChannel(
+ &call_, cricket::MediaChannelOptions(), cricket::AudioOptions())));
rtc::scoped_ptr<cricket::WebRtcVoiceMediaChannel> channel2(
- static_cast<cricket::WebRtcVoiceMediaChannel*>(
- engine_.CreateChannel(&call_, cricket::AudioOptions())));
+ static_cast<cricket::WebRtcVoiceMediaChannel*>(engine_.CreateChannel(
+ &call_, cricket::MediaChannelOptions(), cricket::AudioOptions())));
// Have to add a stream to make SetSend work.
cricket::StreamParams stream1;
@@ -2831,21 +2837,14 @@ TEST_F(WebRtcVoiceEngineTestFake, SetOptionOverridesViaChannels) {
// This test verifies DSCP settings are properly applied on voice media channel.
TEST_F(WebRtcVoiceEngineTestFake, TestSetDscpOptions) {
pbos-webrtc 2016/02/01 14:44:38 Pref ConfiguresDscpInNetworkInterface or something
nisse-webrtc 2016/02/02 11:32:50 Makes sense. But I'm not doing that right away.
EXPECT_TRUE(SetupEngineWithSendStream());
+ cricket::MediaChannelOptions channel_options;
+ channel_options.enable_dscp = true;
rtc::scoped_ptr<cricket::VoiceMediaChannel> channel(
- engine_.CreateChannel(&call_, cricket::AudioOptions()));
+ engine_.CreateChannel(&call_, channel_options, cricket::AudioOptions()));
rtc::scoped_ptr<cricket::FakeNetworkInterface> network_interface(
new cricket::FakeNetworkInterface);
channel->SetInterface(network_interface.get());
- cricket::AudioSendParameters parameters = send_parameters_;
- parameters.options.dscp = rtc::Optional<bool>(true);
- EXPECT_TRUE(channel->SetSendParameters(parameters));
EXPECT_EQ(rtc::DSCP_EF, network_interface->dscp());
- // Verify previous value is not modified if dscp option is not set.
- EXPECT_TRUE(channel->SetSendParameters(send_parameters_));
- EXPECT_EQ(rtc::DSCP_EF, network_interface->dscp());
- parameters.options.dscp = rtc::Optional<bool>(false);
- EXPECT_TRUE(channel->SetSendParameters(parameters));
- EXPECT_EQ(rtc::DSCP_DEFAULT, network_interface->dscp());
}
TEST_F(WebRtcVoiceEngineTestFake, TestGetReceiveChannelId) {
@@ -3168,8 +3167,8 @@ TEST(WebRtcVoiceEngineTest, StartupShutdown) {
EXPECT_TRUE(engine.Init(rtc::Thread::Current()));
rtc::scoped_ptr<webrtc::Call> call(
webrtc::Call::Create(webrtc::Call::Config()));
- cricket::VoiceMediaChannel* channel =
- engine.CreateChannel(call.get(), cricket::AudioOptions());
+ cricket::VoiceMediaChannel* channel = engine.CreateChannel(
+ call.get(), cricket::MediaChannelOptions(), cricket::AudioOptions());
EXPECT_TRUE(channel != nullptr);
delete channel;
engine.Terminate();
@@ -3274,8 +3273,8 @@ TEST(WebRtcVoiceEngineTest, Has32Channels) {
cricket::VoiceMediaChannel* channels[32];
int num_channels = 0;
while (num_channels < arraysize(channels)) {
- cricket::VoiceMediaChannel* channel =
- engine.CreateChannel(call.get(), cricket::AudioOptions());
+ cricket::VoiceMediaChannel* channel = engine.CreateChannel(
+ call.get(), cricket::MediaChannelOptions(), cricket::AudioOptions());
if (!channel)
break;
channels[num_channels++] = channel;
@@ -3296,8 +3295,9 @@ TEST(WebRtcVoiceEngineTest, SetRecvCodecs) {
EXPECT_TRUE(engine.Init(rtc::Thread::Current()));
rtc::scoped_ptr<webrtc::Call> call(
webrtc::Call::Create(webrtc::Call::Config()));
- cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::AudioOptions(),
- call.get());
+ cricket::WebRtcVoiceMediaChannel channel(&engine,
+ cricket::MediaChannelOptions(),
+ cricket::AudioOptions(), call.get());
cricket::AudioRecvParameters parameters;
parameters.codecs = engine.codecs();
EXPECT_TRUE(channel.SetRecvParameters(parameters));

Powered by Google App Engine
This is Rietveld 408576698