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

Unified Diff: webrtc/pc/peerconnection_integrationtest.cc

Issue 2770233003: Implemented the GetSources() in native code. (Closed)
Patch Set: Try to fix the build failure on the bots. Created 3 years, 8 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: webrtc/pc/peerconnection_integrationtest.cc
diff --git a/webrtc/pc/peerconnection_integrationtest.cc b/webrtc/pc/peerconnection_integrationtest.cc
index b4acdaa423f7851b08ee4b2d6e7ec2288e7ef29f..765f59d6b93c14e628e4a6fced701f04f90014ff 100644
--- a/webrtc/pc/peerconnection_integrationtest.cc
+++ b/webrtc/pc/peerconnection_integrationtest.cc
@@ -2755,6 +2755,29 @@ TEST_F(PeerConnectionIntegrationTest, CodecNamesAreCaseInsensitive) {
kMaxWaitForFramesMs);
}
+TEST_F(PeerConnectionIntegrationTest, GetContributingSources) {
+ ASSERT_TRUE(CreatePeerConnectionWrappers());
+ ConnectFakeSignaling();
+ caller()->AddAudioVideoMediaStream();
+ callee()->AddAudioVideoMediaStream();
+ caller()->CreateAndSetAndSignalOffer();
+ ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout);
+ ExpectNewFramesReceivedWithWait(
+ kDefaultExpectedAudioFrameCount, kDefaultExpectedVideoFrameCount,
+ kDefaultExpectedAudioFrameCount, kDefaultExpectedVideoFrameCount,
+ kMaxWaitForFramesMs);
+ ASSERT_GT(callee()->pc()->GetReceivers().size(), 0u);
+ auto receiver = callee()->pc()->GetReceivers()[0];
+ ASSERT_EQ(receiver->media_type(), cricket::MEDIA_TYPE_AUDIO);
+
+ auto contributing_sources = receiver->GetContributingSources();
+ ASSERT_GT(receiver->GetParameters().encodings.size(), 0u);
+ EXPECT_EQ(receiver->GetParameters().encodings[0].ssrc,
+ contributing_sources[0].source());
+ EXPECT_EQ(receiver->GetParameters().encodings[0].ssrc,
+ contributing_sources[0].ssrc());
+}
+
} // namespace
#endif // if !defined(THREAD_SANITIZER)

Powered by Google App Engine
This is Rietveld 408576698