Bug 1301675 - Test that a track from MediaStreamAudioDestinationNode can be stopped. r?padenot draft
authorAndreas Pehrson <pehrsons@gmail.com>
Fri, 16 Sep 2016 11:50:20 +0200
changeset 432222 07ee983c15074517fdadcda54f4bcae827f87b6f
parent 432221 a1ff0b48cde6209a2c714880b694b8fa6f527b7c
child 432223 4e34991643cc47049aa501bcd4476785b0d43f81
push id34235
push userbmo:pehrson@telenordigital.com
push dateTue, 01 Nov 2016 13:40:03 +0000
reviewerspadenot
bugs1301675
milestone52.0a1
Bug 1301675 - Test that a track from MediaStreamAudioDestinationNode can be stopped. r?padenot MozReview-Commit-ID: 5wViWJQmI2H
dom/media/webaudio/test/test_mediaStreamAudioDestinationNode.html
--- 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>