Index: talk/media/webrtc/webrtcvoiceengine_unittest.cc |
diff --git a/talk/media/webrtc/webrtcvoiceengine_unittest.cc b/talk/media/webrtc/webrtcvoiceengine_unittest.cc |
index 0dc7b510eea7d6eaa62c9deee2f35a8d313b514a..c3c05642d6c39051bd5df06fe34d2cb7eeaef322 100644 |
--- a/talk/media/webrtc/webrtcvoiceengine_unittest.cc |
+++ b/talk/media/webrtc/webrtcvoiceengine_unittest.cc |
@@ -3353,6 +3353,36 @@ TEST(WebRtcVoiceEngineTest, CoInitialize) { |
} |
#endif |
+TEST_F(WebRtcVoiceEngineTestFake, SetsSyncGroupFromSyncLabel) { |
+ // Test that changing the combined_audio_video_bwe option results in the |
the sun
2015/06/11 11:52:04
c/p error
pbos-webrtc
2015/06/11 14:48:53
Done.
|
+ // expected state changes on an associated Call. |
+ cricket::FakeCall call(webrtc::Call::Config(nullptr)); |
+ const uint32 kAudioSsrc = 123; |
+ const std::string kSyncLabel = "AvSyncLabel"; |
+ |
+ EXPECT_TRUE(SetupEngine()); |
+ cricket::WebRtcVoiceMediaChannel* media_channel = |
+ static_cast<cricket::WebRtcVoiceMediaChannel*>(channel_); |
+ media_channel->SetCall(&call); |
+ cricket::StreamParams sp = cricket::StreamParams::CreateLegacy(kAudioSsrc); |
+ sp.sync_label = kSyncLabel; |
+ // Creating two channels to make sure that sync label is set properly for both |
+ // the default voice channel and following ones. |
+ EXPECT_TRUE(channel_->AddRecvStream(sp)); |
+ sp.ssrcs[0] += 1; |
+ EXPECT_TRUE(channel_->AddRecvStream(sp)); |
+ |
+ ASSERT_EQ(2, call.GetAudioReceiveStreams().size()); |
+ EXPECT_EQ(kSyncLabel, |
+ call.GetAudioReceiveStream(kAudioSsrc)->GetConfig().sync_group) |
+ << "SyncGroup should be set based on sync_label"; |
+ EXPECT_EQ(kSyncLabel, |
+ call.GetAudioReceiveStream(kAudioSsrc + 1)->GetConfig().sync_group) |
+ << "SyncGroup should be set based on sync_label"; |
+ |
+ media_channel->SetCall(nullptr); |
+} |
+ |
TEST_F(WebRtcVoiceEngineTestFake, ChangeCombinedBweOption_Call) { |
// Test that changing the combined_audio_video_bwe option results in the |
// expected state changes on an associated Call. |
@@ -3370,20 +3400,36 @@ TEST_F(WebRtcVoiceEngineTestFake, ChangeCombinedBweOption_Call) { |
cricket::StreamParams::CreateLegacy(kAudioSsrc2))); |
// Combined BWE should not be set up yet. |
- EXPECT_EQ(0, call.GetAudioReceiveStreams().size()); |
+ EXPECT_EQ(2, call.GetAudioReceiveStreams().size()); |
+ EXPECT_TRUE(call.GetAudioReceiveStream(kAudioSsrc1) |
the sun
2015/06/11 11:52:04
Is this really style guide compliant formatting?
pbos-webrtc
2015/06/11 14:48:53
Yep, where style == clang-format with Chromium set
|
+ ->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)); |
EXPECT_EQ(2, call.GetAudioReceiveStreams().size()); |
- EXPECT_NE(nullptr, call.GetAudioReceiveStream(kAudioSsrc1)); |
- EXPECT_NE(nullptr, call.GetAudioReceiveStream(kAudioSsrc2)); |
+ EXPECT_FALSE(call.GetAudioReceiveStream(kAudioSsrc1) |
+ ->GetConfig() |
+ .rtp.extensions.empty()); |
+ EXPECT_FALSE(call.GetAudioReceiveStream(kAudioSsrc2) |
+ ->GetConfig() |
+ .rtp.extensions.empty()); |
// Disable combined BWE option - should be disabled again. |
options.combined_audio_video_bwe.Set(false); |
EXPECT_TRUE(media_channel->SetOptions(options)); |
- EXPECT_EQ(0, call.GetAudioReceiveStreams().size()); |
+ EXPECT_EQ(2, call.GetAudioReceiveStreams().size()); |
+ EXPECT_TRUE(call.GetAudioReceiveStream(kAudioSsrc1) |
+ ->GetConfig() |
+ .rtp.extensions.empty()); |
+ EXPECT_TRUE(call.GetAudioReceiveStream(kAudioSsrc2) |
+ ->GetConfig() |
+ .rtp.extensions.empty()); |
media_channel->SetCall(nullptr); |
} |
@@ -3620,4 +3666,3 @@ TEST_F(WebRtcVoiceEngineTestFake, AssociateChannelResetUponDeleteChannnel) { |
EXPECT_TRUE(channel_->RemoveSendStream(2)); |
EXPECT_EQ(voe_.GetAssociateSendChannel(recv_ch), -1); |
} |
- |