Bug 1295352 - Update mediaElementCapture tests to stop all tracks before finishing. r=jib

MozReview-Commit-ID: GnfFt1vIbig

--HG--
extra : rebase_source : 005bcde1072282b25f751e38c1ea3dc059811ada
extra : intermediate-source : 907d83f3649296a187ab5e8b98475ad3b8b88bc2
extra : source : ead33662607bf6bc37bbcf8de6ed7daf5d773ca6
This commit is contained in:
Andreas Pehrson 2016-08-29 16:37:16 +02:00
parent d0bbc5938c
commit aafd1d4711
2 changed files with 7 additions and 2 deletions

View File

@ -104,7 +104,9 @@ runTest(() => getUserMedia({audio: true})
array[analyser.binIndexForFrequency(TEST_AUDIO_FREQ)] < 50 &&
array[analyser.binIndexForFrequency(1500)] < 50 &&
array[analyser.binIndexForFrequency(2000)] > 200 &&
array[analyser.binIndexForFrequency(2500)] < 50);
array[analyser.binIndexForFrequency(2500)] < 50)
.then(() => [gUMTrack, ...gUMAudioElement.srcObject.getTracks()]
.forEach(t => t.stop()));
})
.then(() => ok(true, "Test passed."))
.catch(e => ok(false, "Test failed: " + e + (e.stack ? "\n" + e.stack : ""))));

View File

@ -110,7 +110,10 @@ runTest(() => getUserMedia({video: true, fake: true})
gUMVideoElement.play();
return checkVideoPlaying(captureStreamElement);
})
.then(() => ok(true, "Test passed."))
.then(() => {
gUMVideoElement.srcObject.getTracks().forEach(t => t.stop());
ok(true, "Test passed.");
})
.catch(e => ok(false, "Test failed: " + e + (e.stack ? "\n" + e.stack : ""))));
</script>