haikuwebkit/LayoutTests/fast/animation/request-animation-frame-too...

39 lines
754 B
HTML

<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<span id="e"></span>
<span id="f"></span>
<script>
description("Tests that requestAnimationFrame callbacks aren't called too rapidly (above 1000FPS)");
var numCallbacks = 0;
var e = document.getElementById("e");
function next() {
window.requestAnimationFrame(function () {
numCallbacks++;
next();
}, e);
}
next();
if (window.testRunner)
testRunner.waitUntilDone();
// Set the timeout after the first callback.
setTimeout(function() {
isSuccessfullyParsed();
shouldBeGreaterThanOrEqual("100", "numCallbacks");
if (window.testRunner)
window.testRunner.notifyDone();
}, 100);
</script>
</body>
</html>