Bug 1321235 - Add a mochitest. r=jesup
authorAndreas Pehrson <pehrsons@gmail.com>
Thu, 01 Dec 2016 19:35:15 +0100
changeset 325107 7f0eb04ee1d58b0f28085bea908ad5a9425e85c2
parent 325106 2a82f16d575ed10d4d4e10cd64ccff3661a93e5b
child 325108 eea552a9e16285b98c5971e7a8a7c141a55477d4
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersjesup
bugs1321235
milestone53.0a1
Bug 1321235 - Add a mochitest. r=jesup MozReview-Commit-ID: 11gpS79Ce2h
dom/media/tests/mochitest/test_getUserMedia_addTrackRemoveTrack.html
--- a/dom/media/tests/mochitest/test_getUserMedia_addTrackRemoveTrack.html
+++ b/dom/media/tests/mochitest/test_getUserMedia_addTrackRemoveTrack.html
@@ -96,16 +96,24 @@
         checkMediaStreamContains(videoStream, [], "1, Removed original track");
         checkMediaStreamContains(audioStream, [audioTrack, videoTrack],
                                  "2, Added external track");
 
         var elem = createMediaElement('video', 'testAddRemoveOriginalTrackVideo');
         var playback = new LocalMediaStreamPlayback(elem, audioStream);
         return playback.playMedia(false);
       }))
+    .then(() => getUserMedia({ audio: true, video: true })).then(stream => {
+      info("Test removing stopped tracks");
+      stream.getTracks().forEach(t => {
+        t.stop();
+        stream.removeTrack(t);
+      });
+      checkMediaStreamContains(stream, [], "Removed stopped tracks");
+    })
     .then(() => {
       var ac = new AudioContext();
 
       var osc1k = createOscillatorStream(ac, 1000);
       var audioTrack1k = osc1k.getTracks()[0];
 
       var osc5k = createOscillatorStream(ac, 5000);
       var audioTrack5k = osc5k.getTracks()[0];