2012-01-24 16:38:22 -08:00
|
|
|
<!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">
|
2013-10-17 19:10:56 -07:00
|
|
|
|
|
|
|
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();
|
2012-01-24 16:38:22 -08:00
|
|
|
|
|
|
|
function audioAvailable(event) {
|
2013-10-17 19:10:56 -07:00
|
|
|
var a1 = event.target;
|
2012-01-24 16:38:22 -08:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
2013-10-17 19:10:56 -07:00
|
|
|
function metaDataLoaded(event){
|
|
|
|
var a1 = event.target;
|
2012-01-24 16:38:22 -08:00
|
|
|
a1.addEventListener("MozAudioAvailable", audioAvailable, false);
|
|
|
|
a1.mozFrameBufferLength = 9001;
|
|
|
|
a1.play();
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|