Bug 1088621 - Fix test_getUserMedia_constraints.html to stop gUM stream between tests draft
authorJan-Ivar Bruaroey <jib@mozilla.com>
Wed, 27 Jul 2016 14:00:35 -0400
changeset 431534 2af4e13c8c1d9e9ee65f7f93666e4aa085f9951c
parent 431533 69f1284db95b661c6812b3c7b7c3f249fa243556
child 431535 a06c896a69e904a5a5803ac3ed2c6085418bf5d0
push id34060
push userjbruaroey@mozilla.com
push dateSun, 30 Oct 2016 00:39:43 +0000
bugs1088621
milestone52.0a1
Bug 1088621 - Fix test_getUserMedia_constraints.html to stop gUM stream between tests MozReview-Commit-ID: 9marH5SmDi5
dom/media/tests/mochitest/test_getUserMedia_constraints.html
--- a/dom/media/tests/mochitest/test_getUserMedia_constraints.html
+++ b/dom/media/tests/mochitest/test_getUserMedia_constraints.html
@@ -117,16 +117,19 @@ runTest(() => Promise.resolve()
   })
   .then(() => pushPrefs(["media.getusermedia.browser.enabled", false],
                         ["media.getusermedia.screensharing.enabled", false]))
   .then(() => tests.reduce((p, test) => p.then(() => getUserMedia(test.constraints))
     .then(stream => {
       is(null, test.error, test.message);
       stream.getTracks().forEach(t => t.stop());
     }, e => {
+      is(null, test.error, test.message);
+      stream.getTracks().forEach(track => track.stop());
+    }, e => {
       is(e.name, test.error, test.message + ": " + e.message);
       if (test.constraint) {
         is(e.constraint, test.constraint,
            test.message + " w/correct constraint.");
       }
     }), Promise.resolve()))
   .then(() => getUserMedia({video: true, audio: true}))
   .then(stream => stream.getVideoTracks()[0].applyConstraints({ width: 320 })