Bug 1321235 - Add a mochitest. r=jesup a=test-only
authorAndreas Pehrson <pehrsons@gmail.com>
Thu, 01 Dec 2016 19:35:15 +0100
changeset 352874 256286003335b5243c7ef8558c952be740d256ad
parent 352873 85e1c3905c26426d2703e0b30d86e62d9915301b
child 352875 d3c8c1a41bd773b1bf5a29b3c8066448d53d8ff5
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup, test-only
bugs1321235
milestone52.0a2
Bug 1321235 - Add a mochitest. r=jesup a=test-only 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];