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

Unified Diff: talk/app/webrtc/peerconnectioninterface_unittest.cc

Issue 1538673002: Adding a MediaStream parameter to createSender. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years 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: talk/app/webrtc/peerconnectioninterface_unittest.cc
diff --git a/talk/app/webrtc/peerconnectioninterface_unittest.cc b/talk/app/webrtc/peerconnectioninterface_unittest.cc
index 930f538ebdfda264da623bd1cc03e0182d6a16e8..291ae2b5573728477af7e742a883865375c863fe 100644
--- a/talk/app/webrtc/peerconnectioninterface_unittest.cc
+++ b/talk/app/webrtc/peerconnectioninterface_unittest.cc
@@ -1198,6 +1198,26 @@ TEST_F(PeerConnectionInterfaceTest, RemoveTrackAfterAddStream) {
EXPECT_TRUE(video_desc == nullptr);
}
+// Test creating a sender with a stream, and ensure the stream ID is populated
+// in the offer.
+TEST_F(PeerConnectionInterfaceTest, CreateSenderWithStream) {
+ CreatePeerConnection();
+ // Start by adding a voice track, then add a video sender with the same stream
+ // label.
+ AddVoiceStream(kStreamLabel1);
+ MediaStreamInterface* stream = pc_->local_streams()->at(0);
+ pc_->CreateSender("video", stream);
+
+ scoped_ptr<SessionDescriptionInterface> offer;
+ ASSERT_TRUE(DoCreateOffer(offer.use(), nullptr));
+
+ const cricket::MediaContentDescription* video_desc =
+ cricket::GetFirstVideoContentDescription(offer->description());
+ ASSERT_TRUE(video_desc != nullptr);
+ ASSERT_EQ(1u, video_desc->streams().size());
+ EXPECT_EQ(kStreamLabel1, video_desc->streams()[0].sync_label);
+}
+
// Test that we can specify a certain track that we want statistics about.
TEST_F(PeerConnectionInterfaceTest, GetStatsForSpecificTrack) {
InitiateCall();

Powered by Google App Engine
This is Rietveld 408576698