Bug 1248543 - release decoder resources when finishing tests to avoid OOM and failing to open cubeb streams. r=kinetik.

MozReview-Commit-ID: 1LmRNzVFYX9
This commit is contained in:
JW Wang 2016-02-17 10:47:03 +08:00
parent 2624c1bfd1
commit d9a7eb2325
7 changed files with 26 additions and 5 deletions

View File

@ -7,7 +7,8 @@
<video src="0-timescale.mp4"
autoplay
onerror="document.documentElement.className=undefined"
onloadedmetadata="document.documentElement.className=undefined">
onloadedmetadata="this.src=''; document.documentElement.className=undefined">
<!-- Note we reset 'src' to release decoder resources and cubeb streams to prevent OOM or OpenCubeb() failures. -->
</video>
</body>
</html>

View File

@ -21,6 +21,10 @@ function boom()
function done()
{
// Note we reset 'src' to release decoder resources and cubeb streams to
// prevent OOM or OpenCubeb() failures.
var audio = document.getElementById("audio");
audio.src = "";
document.documentElement.removeAttribute("class");
}
</script>

View File

@ -1,7 +1,8 @@
<!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>
<!-- Note we reset 'src' to release decoder resources and cubeb streams to prevent OOM or OpenCubeb() failures. -->
</body>
</html>

View File

@ -4,8 +4,13 @@
<script>
var ITERATIONS = 200;
function stoptest ()
function stoptest (evt)
{
if (evt) {
// Note we reset 'src' to release decoder resources and cubeb streams to
// prevent OOM or OpenCubeb() failures.
evt.target.src = "";
}
document.documentElement.removeAttribute("class");
}

View File

@ -3,6 +3,7 @@
<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>
<!-- Note we reset 'src' to release decoder resources and cubeb streams to prevent OOM or OpenCubeb() failures. -->
</body>
</html>

View File

@ -6,7 +6,13 @@ function boom()
{
var a = document.getElementById("a");
a.play();
a.onplaying = function () { document.documentElement.className = ""; }
a.onplaying = function () {
a.onplaying = null;
// Note we reset 'src' to release decoder resources and cubeb streams to
// prevent OOM or OpenCubeb() failures.
a.src = "";
document.documentElement.className = "";
}
}
</script>
</head>

View File

@ -11,6 +11,9 @@ audioElement.onplaying =
function() {
audioElement.onseeked =
function() {
// Note we reset 'src' to release decoder resources and cubeb
// streams to prevent OOM or OpenCubeb() failures.
audioElement.src = "";
document.documentElement.removeAttribute("class");
};
audioElement.currentTime = 0;