gecko/content/media/test/test_bug686137.html

44 lines
1.2 KiB
HTML

<!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>
<audio id='a1' controls muted></audio>
<pre id="test">
<script class="testbody" type="text/javascript">
var testFile = "bug495794.ogg";
var a1 = document.getElementById('a1');
function audioAvailable(event) {
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(){
a1.addEventListener("MozAudioAvailable", audioAvailable, false);
a1.mozFrameBufferLength = 9001;
a1.play();
}
a1.addEventListener("loadedmetadata", metaDataLoaded, false);
a1.src = testFile;
a1.load();
SimpleTest.waitForExplicitFinish();
</script>
</pre>
</body>
</html>