gecko/content/media/test/test_bug686137.html

48 lines
1.4 KiB
HTML
Raw Normal View History

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=686137
-->
<head>
<title>Media test: changing mozFrameBufferLength</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=686137">Mozilla Bug 686137</a>
<pre id="test">
<script class="testbody" type="text/javascript">
SpecialPowers.pushPrefEnv({"set": [["media.audio_data.enabled", true]]}, function () {
var a1 = document.createElement("audio");
a1.controls = true;
a1.muted = true;
a1.preload = "metadata";
a1.addEventListener("loadedmetadata", metaDataLoaded, false);
a1.src = "bug495794.ogg";
a1.load();
});
SimpleTest.waitForExplicitFinish();
function audioAvailable(event) {
var a1 = event.target;
a1.removeEventListener("MozAudioAvailable", audioAvailable);
is( event.frameBuffer.length, 9001, "event.frameBuffer.length should be 9001.");
is( event.frameBuffer.length, a1.mozFrameBufferLength, "event.frameBuffer.length should be " + a1.mozFrameBufferLength + ".");
SimpleTest.finish();
}
function metaDataLoaded(event){
var a1 = event.target;
a1.addEventListener("MozAudioAvailable", audioAvailable, false);
a1.mozFrameBufferLength = 9001;
a1.play();
}
</script>
</pre>
</body>
</html>