Chromium Code Reviews| Index: webrtc/pc/peerconnection_unittest.cc |
| diff --git a/webrtc/pc/peerconnection_unittest.cc b/webrtc/pc/peerconnection_unittest.cc |
| index e5e310ea0fd17be4fdf8bddfbc3a1bbd942bb994..60046f57cee557bfa1e0cffe933f7dc63e029f32 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) { |
|
Taylor Brandstetter
2017/03/30 22:55:38
I recently refactored the tests in this file, FYI.
Zhi Huang
2017/03/31 06:44:05
Acknowledged.
|
| + 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. |