OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <body> | |
3 <script src="../resources/testharness.js"></script> | |
4 <script src="../resources/testharnessreport.js"></script> | |
5 <script> | |
6 var anim1 = document.body.animate([], 100000); | |
7 var anim2 = document.body.animate([], 100000); | |
8 | |
9 var cancelTest = async_test('Cancelling animation should create cancel event.'); | |
10 var fired = false; | |
11 | |
12 anim1.oncancel = function(event) { | |
13 cancelTest.step(function() { | |
14 assert_equals(event.target, anim1, 'Target of cancel event should be anim1.'
); | |
15 assert_equals(event.currentTime, null, 'currentTime of cancel event should b
e null.'); | |
16 assert_equals(event.timelineTime, document.timeline.currentTime, 'Event time
lineTime should be same as document.timeline.currentTime.'); | |
17 }); | |
18 fired = true; | |
19 }; | |
20 | |
21 anim2.onfinish = function() { | |
22 cancelTest.step(function() { | |
23 assert_true(fired, 'anim1.oncancel should be called.'); | |
24 }); | |
25 cancelTest.done(); | |
26 }; | |
27 | |
28 anim1.cancel(); | |
29 anim2.finish(); | |
30 </script> | |
31 </body> | |
OLD | NEW |