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

Unified Diff: webrtc/pc/peerconnection_unittest.cc

Issue 2770233003: Implemented the GetSources() in native code. (Closed)
Patch Set: Address the comments related to threading and the special ContributingSource that uses the SSRC. Created 3 years, 9 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_unittest.cc
diff --git a/webrtc/pc/peerconnection_unittest.cc b/webrtc/pc/peerconnection_unittest.cc
index e5e310ea0fd17be4fdf8bddfbc3a1bbd942bb994..03503fbde1bfb8ee16d0c7e4d36fbe82287d9c7b 100644
--- a/webrtc/pc/peerconnection_unittest.cc
+++ b/webrtc/pc/peerconnection_unittest.cc
@@ -2638,6 +2638,22 @@ TEST_F(P2PTestConductor, EndToEndConnectionTimeWithTurnTurnPair) {
delete set_receiving_client(nullptr);
}
+// The end to end test of the method GetContributingSources(). Tests the
+// function calling chain from API layer down to the rtp_rtcp module.
+TEST_F(P2PTestConductor, TestGetContributingSources) {
+ ASSERT_TRUE(CreateTestClients());
+ LocalP2PTest();
+
+ ASSERT_GT(receiving_client()->pc()->GetReceivers().size(), 0);
+ auto receiver = receiving_client()->pc()->GetReceivers()[0];
+ ASSERT_EQ(receiver->media_type(), cricket::MEDIA_TYPE_AUDIO);
+
+ auto contributing_sources = receiver->GetContributingSources();
+ ASSERT_GT(receiver->GetParameters().encodings.size(), 0);
+ EXPECT_EQ(receiver->GetParameters().encodings[0].ssrc,
+ contributing_sources[0].source);
+}
+
class IceServerParsingTest : public testing::Test {
public:
// Convenience for parsing a single URL.

Powered by Google App Engine
This is Rietveld 408576698