Bug 1301675 - Test that a track from MediaStreamAudioDestinationNode can be stopped. r?padenot
MozReview-Commit-ID: 5wViWJQmI2H
--- a/dom/media/webaudio/test/test_mediaStreamAudioDestinationNode.html
+++ b/dom/media/webaudio/test/test_mediaStreamAudioDestinationNode.html
@@ -29,16 +29,22 @@ addLoadEvent(function() {
var elem = document.getElementById('audioelem');
elem.srcObject = dest.stream;
elem.onloadedmetadata = function() {
ok(true, "got metadata event");
setTimeout(function() {
is(elem.played.length, 1, "should have a played interval");
is(elem.played.start(0), 0, "should have played immediately");
isnot(elem.played.end(0), 0, "should have played for a non-zero interval");
- SimpleTest.finish();
+
+ // This will end the media element.
+ dest.stream.getTracks()[0].stop();
}, 2000);
};
+ elem.onended = function() {
+ ok(true, "media element ended after destination track.stop()");
+ SimpleTest.finish();
+ };
source.start(0);
elem.play();
});
</script>