Bug 1248543 - release decoder resources when finishing tests to avoid OOM and failing to open cubeb streams. r=kinetik. draft
authorJW Wang <jwwang@mozilla.com>
Tue, 16 Feb 2016 18:02:16 +0800
changeset 331198 97b3caf37f3c593f8e876782eb45e02255c25a05
parent 331197 ccac186674590d7429473b3d8ed58d115c9666da
child 514329 5d67baf9aa36466ac29e1e67dd4027c7c2d9ad6c
push id10929
push userjwwang@mozilla.com
push dateTue, 16 Feb 2016 14:12:33 +0000
reviewerskinetik
bugs1248543
milestone47.0a1
Bug 1248543 - release decoder resources when finishing tests to avoid OOM and failing to open cubeb streams. r=kinetik. MozReview-Commit-ID: 7eNahds9Ly0
dom/media/test/crashtests/0-timescale.html
dom/media/test/crashtests/459439-1.html
dom/media/test/crashtests/495794-1.html
dom/media/test/crashtests/691096-1.html
dom/media/test/crashtests/789075-1.html
dom/media/test/crashtests/795892-1.html
dom/media/test/crashtests/media-element-source-seek-1.html
--- a/dom/media/test/crashtests/0-timescale.html
+++ b/dom/media/test/crashtests/0-timescale.html
@@ -2,12 +2,12 @@
 <html class="reftest-wait">
 <head>
 </head>
 <body>
 <!-- This video file has a timescale of 0 in the mdhd atom -->
 <video src="0-timescale.mp4"
        autoplay
        onerror="document.documentElement.className=undefined"
-       onloadedmetadata="document.documentElement.className=undefined">
+       onloadedmetadata="this.src=''; document.documentElement.className=undefined">
 </video>
 </body>
 </html>
--- a/dom/media/test/crashtests/459439-1.html
+++ b/dom/media/test/crashtests/459439-1.html
@@ -16,16 +16,18 @@ function boom()
 
   ++i;
 
   setTimeout(done, 1);
 }
 
 function done()
 {
+  var audio = document.getElementById("audio");
+  audio.src = "";
   document.documentElement.removeAttribute("class");
 }
 </script>
 </head>
 <body>
 <audio id="audio" autoplay src="sound.ogg" oncanplaythrough="setTimeout(boom, 1);"></audio>
 <div id="div"></div>
 </body>
--- a/dom/media/test/crashtests/495794-1.html
+++ b/dom/media/test/crashtests/495794-1.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html class="reftest-wait">
   <body>
-    <audio src="495794-1.ogg" autoplay onended="document.documentElement.className=undefined"></audio>
+    <audio src="495794-1.ogg" autoplay onended="this.src=''; document.documentElement.className=undefined"></audio>
   </body>
 </html>
 
--- a/dom/media/test/crashtests/691096-1.html
+++ b/dom/media/test/crashtests/691096-1.html
@@ -1,16 +1,19 @@
 <!DOCTYPE html>
 <html class="reftest-wait">
 <head> 
 <script>
 var ITERATIONS = 200;
 
-function stoptest ()
+function stoptest (evt)
 {
+   if (evt) {
+     evt.target.src = "";
+   }
    document.documentElement.removeAttribute("class");
 }
 
 function boom()
 {
     for (var i = 0; i < ITERATIONS; ++i) {
         a = document.createElementNS("http://www.w3.org/1999/xhtml", "audio");
         a.addEventListener("loadedmetadata", stoptest);
--- a/dom/media/test/crashtests/789075-1.html
+++ b/dom/media/test/crashtests/789075-1.html
@@ -1,8 +1,8 @@
 <!DOCTYPE html>
 <html class="reftest-wait">
 <head>
 </head>
 <body>
-<video src="789075.webm" preload="metadata" onloadedmetadata="document.documentElement.className=undefined"></video>
+<video src="789075.webm" preload="metadata" onloadedmetadata="this.src=''; document.documentElement.className=undefined"></video>
 </body>
 </html>
--- a/dom/media/test/crashtests/795892-1.html
+++ b/dom/media/test/crashtests/795892-1.html
@@ -1,17 +1,21 @@
 <!DOCTYPE html>
 <html class="reftest-wait">
 <head>
 <script>
 function boom()
 {
   var a = document.getElementById("a");
   a.play();
-  a.onplaying = function () { document.documentElement.className = ""; }
+  a.onplaying = function () {
+    a.onplaying = null;
+    a.src = "";
+    document.documentElement.className = "";
+  }
 }
 </script>
 </head>
 
 <body>
 <video id="a" src="cors.webm" crossorigin preload="metadata" onloadedmetadata="boom();">
 </body>
 </html>
--- a/dom/media/test/crashtests/media-element-source-seek-1.html
+++ b/dom/media/test/crashtests/media-element-source-seek-1.html
@@ -6,16 +6,17 @@ audioElement.autoplay = true;
 audioElement.src = "sound.ogg";
 audioElement.onplaying =
   function() {
     audioElement.onplaying = null;
     setTimeout(
       function() {
         audioElement.onseeked =
           function() {
+            audioElement.src = "";
             document.documentElement.removeAttribute("class");
           };
         audioElement.currentTime = 0;
       }, 100);
   };
 
 var context = new window.AudioContext();
 var source = context.createMediaElementSource(audioElement);