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

Unified Diff: webrtc/pc/peerconnection_integrationtest.cc

Issue 2770233003: Implemented the GetSources() in native code. (Closed)
Patch Set: Add a direct dependency to the webrtc/voice_engine/BUILD.gn 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..d818300c23f1fe4846d899b3eab589ced74fe771 100644
--- a/webrtc/pc/peerconnection_integrationtest.cc
+++ b/webrtc/pc/peerconnection_integrationtest.cc
@@ -2755,6 +2755,24 @@ TEST_F(PeerConnectionIntegrationTest, CodecNamesAreCaseInsensitive) {
kMaxWaitForFramesMs);
}
+TEST_F(PeerConnectionIntegrationTest, GetSources) {
+ ASSERT_TRUE(CreatePeerConnectionWrappers());
+ ConnectFakeSignaling();
+ caller()->AddAudioOnlyMediaStream();
+ caller()->CreateAndSetAndSignalOffer();
+ ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout);
+ // Wait for one audio frame received by callee.
+ ExpectNewFramesReceivedWithWait(0, 0, 1, 0, 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->GetSources();
+ ASSERT_GT(receiver->GetParameters().encodings.size(), 0u);
+ EXPECT_EQ(receiver->GetParameters().encodings[0].ssrc,
+ contributing_sources[0].source_id());
+}
+
} // namespace
#endif // if !defined(THREAD_SANITIZER)

Powered by Google App Engine
This is Rietveld 408576698