blob: c2f0bc361815e68d57be40c39f6f3dd4711a98e7 [file] [log] [blame]
<!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 one requestAnimationFrame callback cancelling a second");
var e = document.getElementById("e");
var secondCallbackId;
var callbackFired = false;
var cancelFired = false;
window.requestAnimationFrame(function() {
cancelFired = true;
window.cancelAnimationFrame(secondCallbackId);
}, e);
secondCallbackId = window.requestAnimationFrame(function() {
callbackFired = true;
}, e);
if (window.testRunner)
testRunner.displayAndTrackRepaints();
setTimeout(function() {
shouldBeFalse("callbackFired");
shouldBeTrue("cancelFired");
}, 100);
if (window.testRunner)
testRunner.waitUntilDone();
setTimeout(function() {
isSuccessfullyParsed();
if (window.testRunner)
testRunner.notifyDone();
}, 200);
</script>
</body>
</html>