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

Unified Diff: webrtc/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: 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/webrtcvoiceengine.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/webrtc/webrtcvoiceengine_unittest.cc
diff --git a/webrtc/media/webrtc/webrtcvoiceengine_unittest.cc b/webrtc/media/webrtc/webrtcvoiceengine_unittest.cc
index 987567a34b291a8a5f0dd295335c89b5ca46486f..0e210fc44704546c5d4f5f6a12d3383041ce2d85 100644
--- a/webrtc/media/webrtc/webrtcvoiceengine_unittest.cc
+++ b/webrtc/media/webrtc/webrtcvoiceengine_unittest.cc
@@ -94,7 +94,9 @@ 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() {
@@ -154,7 +156,9 @@ 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
@@ -431,7 +435,9 @@ 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);
}
@@ -1718,7 +1724,9 @@ 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;
@@ -1835,7 +1843,9 @@ 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;
@@ -2366,7 +2376,9 @@ 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();
@@ -2795,10 +2807,14 @@ TEST_F(WebRtcVoiceEngineTestFake, SetOptionOverridesViaChannels) {
EXPECT_TRUE(SetupEngineWithSendStream());
rtc::scoped_ptr<cricket::WebRtcVoiceMediaChannel> channel1(
static_cast<cricket::WebRtcVoiceMediaChannel*>(
- engine_.CreateChannel(&call_, cricket::AudioOptions())));
+ engine_.CreateChannel(&call_,
+ cricket::MediaChannelOptions(),
+ cricket::AudioOptions())));
rtc::scoped_ptr<cricket::WebRtcVoiceMediaChannel> channel2(
static_cast<cricket::WebRtcVoiceMediaChannel*>(
- engine_.CreateChannel(&call_, cricket::AudioOptions())));
+ engine_.CreateChannel(&call_,
+ cricket::MediaChannelOptions(),
+ cricket::AudioOptions())));
// Have to add a stream to make SetSend work.
cricket::StreamParams stream1;
@@ -2892,23 +2908,21 @@ TEST_F(WebRtcVoiceEngineTestFake, SetOptionOverridesViaChannels) {
}
// This test verifies DSCP settings are properly applied on voice media channel.
+
+// TODO(nisse): Recreate channel with different settings, like for
+// WebRtcVideoChannel2Test.TestSetDscpOptions
TEST_F(WebRtcVoiceEngineTestFake, TestSetDscpOptions) {
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) {
@@ -3167,7 +3181,9 @@ TEST(WebRtcVoiceEngineTest, StartupShutdown) {
rtc::scoped_ptr<webrtc::Call> call(
webrtc::Call::Create(webrtc::Call::Config()));
cricket::VoiceMediaChannel* channel =
- engine.CreateChannel(call.get(), cricket::AudioOptions());
+ engine.CreateChannel(call.get(),
+ cricket::MediaChannelOptions(),
+ cricket::AudioOptions());
EXPECT_TRUE(channel != nullptr);
delete channel;
engine.Terminate();
@@ -3273,7 +3289,9 @@ TEST(WebRtcVoiceEngineTest, Has32Channels) {
int num_channels = 0;
while (num_channels < arraysize(channels)) {
cricket::VoiceMediaChannel* channel =
- engine.CreateChannel(call.get(), cricket::AudioOptions());
+ engine.CreateChannel(call.get(),
+ cricket::MediaChannelOptions(),
+ cricket::AudioOptions());
if (!channel)
break;
channels[num_channels++] = channel;
@@ -3294,7 +3312,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(),
+ cricket::WebRtcVoiceMediaChannel channel(&engine,
+ cricket::MediaChannelOptions(),
+ cricket::AudioOptions(),
call.get());
cricket::AudioRecvParameters parameters;
parameters.codecs = engine.codecs();
« no previous file with comments | « webrtc/media/webrtc/webrtcvoiceengine.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698