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

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

Issue 1256803004: Control combined_audio_video_bwe with config bool. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: default config combined_audio_video_bwe to false Created 5 years, 5 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 | « talk/media/webrtc/webrtcvoiceengine.cc ('k') | webrtc/audio_receive_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/media/webrtc/webrtcvoiceengine_unittest.cc
diff --git a/talk/media/webrtc/webrtcvoiceengine_unittest.cc b/talk/media/webrtc/webrtcvoiceengine_unittest.cc
index 77f437c60a615746a2be74789bec0322795915a9..c559e39f8392af12a4b7a275ad15c011a5da53b5 100644
--- a/talk/media/webrtc/webrtcvoiceengine_unittest.cc
+++ b/talk/media/webrtc/webrtcvoiceengine_unittest.cc
@@ -3381,7 +3381,7 @@ TEST_F(WebRtcVoiceEngineTestFake, SetsSyncGroupFromSyncLabel) {
media_channel->SetCall(nullptr);
}
-TEST_F(WebRtcVoiceEngineTestFake, ChangeCombinedBweOption_Call) {
+TEST_F(WebRtcVoiceEngineTestFake, CanChangeCombinedBweOption) {
// Test that changing the combined_audio_video_bwe option results in the
// expected state changes on an associated Call.
cricket::FakeCall call(webrtc::Call::Config(nullptr));
@@ -3399,42 +3399,42 @@ TEST_F(WebRtcVoiceEngineTestFake, ChangeCombinedBweOption_Call) {
EXPECT_TRUE(media_channel->AddRecvStream(
cricket::StreamParams::CreateLegacy(kAudioSsrc2)));
- // Combined BWE should not be set up yet (no RTP extensions).
- EXPECT_EQ(2, call.GetAudioReceiveStreams().size());
- EXPECT_TRUE(call.GetAudioReceiveStream(kAudioSsrc1)
- ->GetConfig()
- .rtp.extensions.empty());
- EXPECT_TRUE(call.GetAudioReceiveStream(kAudioSsrc2)
- ->GetConfig()
- .rtp.extensions.empty());
-
- // Enable combined BWE option - now it should be set up.
- cricket::AudioOptions options;
- options.combined_audio_video_bwe.Set(true);
- EXPECT_TRUE(media_channel->SetOptions(options));
+ // Combined BWE should not be set up yet.
EXPECT_EQ(2, call.GetAudioReceiveStreams().size());
EXPECT_FALSE(call.GetAudioReceiveStream(kAudioSsrc1)
->GetConfig()
- .rtp.extensions.empty());
+ .combined_audio_video_bwe);
EXPECT_FALSE(call.GetAudioReceiveStream(kAudioSsrc2)
->GetConfig()
- .rtp.extensions.empty());
+ .combined_audio_video_bwe);
- // Disable combined BWE option - should be disabled again.
- options.combined_audio_video_bwe.Set(false);
+ // Enable combined BWE option - now it should be set up.
+ cricket::AudioOptions options;
+ options.combined_audio_video_bwe.Set(true);
EXPECT_TRUE(media_channel->SetOptions(options));
EXPECT_EQ(2, call.GetAudioReceiveStreams().size());
EXPECT_TRUE(call.GetAudioReceiveStream(kAudioSsrc1)
->GetConfig()
- .rtp.extensions.empty());
+ .combined_audio_video_bwe);
EXPECT_TRUE(call.GetAudioReceiveStream(kAudioSsrc2)
->GetConfig()
- .rtp.extensions.empty());
+ .combined_audio_video_bwe);
+
+ // Disable combined BWE option - should be disabled again.
+ options.combined_audio_video_bwe.Set(false);
+ EXPECT_TRUE(media_channel->SetOptions(options));
+ EXPECT_EQ(2, call.GetAudioReceiveStreams().size());
+ EXPECT_FALSE(call.GetAudioReceiveStream(kAudioSsrc1)
+ ->GetConfig()
+ .combined_audio_video_bwe);
+ EXPECT_FALSE(call.GetAudioReceiveStream(kAudioSsrc2)
+ ->GetConfig()
+ .combined_audio_video_bwe);
media_channel->SetCall(nullptr);
}
-TEST_F(WebRtcVoiceEngineTestFake, ConfigureCombinedBwe_Call) {
+TEST_F(WebRtcVoiceEngineTestFake, SetCallConfiguresAudioReceiveChannels) {
// Test that calling SetCall() on the voice media channel results in the
// expected state changes in Call.
cricket::FakeCall call(webrtc::Call::Config(nullptr));
@@ -3445,9 +3445,6 @@ TEST_F(WebRtcVoiceEngineTestFake, ConfigureCombinedBwe_Call) {
EXPECT_TRUE(SetupEngine());
cricket::WebRtcVoiceMediaChannel* media_channel =
static_cast<cricket::WebRtcVoiceMediaChannel*>(channel_);
- cricket::AudioOptions options;
- options.combined_audio_video_bwe.Set(true);
- EXPECT_TRUE(media_channel->SetOptions(options));
EXPECT_TRUE(media_channel->AddRecvStream(
cricket::StreamParams::CreateLegacy(kAudioSsrc1)));
EXPECT_TRUE(media_channel->AddRecvStream(
@@ -3474,7 +3471,7 @@ TEST_F(WebRtcVoiceEngineTestFake, ConfigureCombinedBwe_Call) {
EXPECT_EQ(0, call.GetAudioReceiveStreams().size());
}
-TEST_F(WebRtcVoiceEngineTestFake, ConfigureCombinedBweForNewRecvStreams_Call) {
+TEST_F(WebRtcVoiceEngineTestFake, ConfigureCombinedBweForNewRecvStreams) {
// Test that adding receive streams after enabling combined bandwidth
// estimation will correctly configure each channel.
cricket::FakeCall call(webrtc::Call::Config(nullptr));
@@ -3492,6 +3489,9 @@ TEST_F(WebRtcVoiceEngineTestFake, ConfigureCombinedBweForNewRecvStreams_Call) {
EXPECT_TRUE(media_channel->AddRecvStream(
cricket::StreamParams::CreateLegacy(kSsrcs[i])));
EXPECT_NE(nullptr, call.GetAudioReceiveStream(kSsrcs[i]));
+ EXPECT_TRUE(call.GetAudioReceiveStream(kSsrcs[i])
+ ->GetConfig()
+ .combined_audio_video_bwe);
}
EXPECT_EQ(ARRAY_SIZE(kSsrcs), call.GetAudioReceiveStreams().size());
@@ -3499,7 +3499,7 @@ TEST_F(WebRtcVoiceEngineTestFake, ConfigureCombinedBweForNewRecvStreams_Call) {
EXPECT_EQ(0, call.GetAudioReceiveStreams().size());
}
-TEST_F(WebRtcVoiceEngineTestFake, ConfigureCombinedBweExtensions_Call) {
+TEST_F(WebRtcVoiceEngineTestFake, ConfiguresAudioReceiveStreamRtpExtensions) {
// Test that setting the header extensions results in the expected state
// changes on an associated Call.
cricket::FakeCall call(webrtc::Call::Config(nullptr));
@@ -3511,9 +3511,6 @@ TEST_F(WebRtcVoiceEngineTestFake, ConfigureCombinedBweExtensions_Call) {
cricket::WebRtcVoiceMediaChannel* media_channel =
static_cast<cricket::WebRtcVoiceMediaChannel*>(channel_);
media_channel->SetCall(&call);
- cricket::AudioOptions options;
- options.combined_audio_video_bwe.Set(true);
- EXPECT_TRUE(media_channel->SetOptions(options));
for (uint32 ssrc : ssrcs) {
EXPECT_TRUE(media_channel->AddRecvStream(
cricket::StreamParams::CreateLegacy(ssrc)));
« no previous file with comments | « talk/media/webrtc/webrtcvoiceengine.cc ('k') | webrtc/audio_receive_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698