Crash beneath ScriptedAnimationController::serviceScriptedAnimations after a requestA...
[WebKit-https.git] / LayoutTests / fast / animation / request-animation-frame-cancel2.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <span id="e"></span>
8 <span id="f"></span>
9 <script>
10 description("Tests one requestAnimationFrame callback cancelling a second");
11
12 var e = document.getElementById("e");
13 var secondCallbackId;
14 var callbackFired = false;
15 var cancelFired = false;
16
17 window.requestAnimationFrame(function() {
18     cancelFired = true;
19     window.cancelAnimationFrame(secondCallbackId);
20 }, e);
21
22 secondCallbackId = window.requestAnimationFrame(function() {
23     callbackFired = true;
24 }, e);
25
26 if (window.testRunner)
27     testRunner.displayAndTrackRepaints();
28
29 setTimeout(function() {
30     shouldBeFalse("callbackFired");
31     shouldBeTrue("cancelFired");
32 }, 100);
33
34 if (window.testRunner)
35     testRunner.waitUntilDone();
36
37 setTimeout(function() {
38     isSuccessfullyParsed();
39     if (window.testRunner)
40         testRunner.notifyDone();
41 }, 200);
42 </script>
43 </body>
44 </html>