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

Unified Diff: content/test/data/media/peerconnection-call.html

Issue 13496009: Hookup the MediaStream glue for Adding and Removing tracks to an existing MediaStream. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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: content/test/data/media/peerconnection-call.html
diff --git a/content/test/data/media/peerconnection-call.html b/content/test/data/media/peerconnection-call.html
index 7581b729947e8f3370b4d4aa4652e232c6090185..02123e55af2e68fc92c5c5419fac683eff8e2aef 100644
--- a/content/test/data/media/peerconnection-call.html
+++ b/content/test/data/media/peerconnection-call.html
@@ -109,6 +109,16 @@
// Do the DTMF test after we have received video.
detectVideoIn('remote-view-2', onCallEstablished);
}
+
+ // Test call with a new Video MediaStream that has been created based on a
+ // stream generated by getUserMedia.
+ function callWithNewVideoMediaStream() {
+ createConnections(null);
+ navigator.webkitGetUserMedia({audio:true, video:true},
+ createNewVideoStreamAndAddToBothConnections, printGetUserMediaError);
+ waitForVideo('remote-view-1');
+ waitForVideo('remote-view-2');
+ }
// This function is used for setting up a test that:
// 1. Creates a data channel on |gFirstConnection| and sends data to
@@ -156,6 +166,7 @@
}
}
}
+
function onToneChange(tone) {
gSentTones += tone.tone;
@@ -203,6 +214,16 @@
gFirstConnection.addStream(localStream);
negotiate();
}
+
+ // Called if getUserMedia succeeds when we want to send a modified
+ // MediaStream. A new MediaStream is created and the video track from
+ // |localStream| is added.
+ function createNewVideoStreamAndAddToBothConnections(localStream) {
+ var new_stream = new webkitMediaStream(localStream.getAudioTracks());
+ new_stream.addTrack(localStream.getVideoTracks()[0]);
+ new_stream.removeTrack(new_stream.getAudioTracks()[0]);
+ addStreamToBothConnectionsAndNegotiate(new_stream);
+ }
function negotiate() {
gFirstConnection.createOffer(onOfferCreated);

Powered by Google App Engine
This is Rietveld 408576698