Bug 686137 - Add test for setting mozFrameBufferLength. r=kinetik

This commit is contained in:
Christopher De Cairos 2012-01-25 13:38:22 +13:00
Родитель fb5445ef8a
Коммит 868056accd
2 изменённых файлов: 44 добавлений и 0 удалений

Просмотреть файл

@ -276,6 +276,7 @@ _TEST_FILES += \
test_audio_event_adopt.html \
test_framebuffer.html \
test_referer.html \
test_bug686137.html \
$(NULL)
else
_TEST_FILES += \

Просмотреть файл

@ -0,0 +1,43 @@
<!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>