Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / animations / animation-events-unprefixed-04.html
blob9f858604b6060ac67c9f554f328fa3f8da1c1d52
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Tests that custom events with unprefixed animations names are correctly dispatched.</title>
5 <script>
6 if (window.testRunner) {
7 testRunner.dumpAsText();
8 testRunner.waitUntilDone();
11 document.addEventListener('animationstart', function(e) {
12 document.getElementById('result').innerHTML += 'PASS: animationstart event listener has been called.<br>';
13 }, false);
15 document.addEventListener('webkitAnimationStart', function(e) {
16 document.getElementById('result').innerHTML += 'FAIL: webkitAnimationStart event listener should not have been called.<br>';
17 }, false);
19 document.addEventListener('animationiteration', function(e) {
20 document.getElementById('result').innerHTML += 'PASS: animationiteration event listener has been called.<br>';
21 }, false);
23 document.addEventListener('webkitAnimationIteration', function(e) {
24 document.getElementById('result').innerHTML += 'FAIL: webkitAnimationIteration event listener should not have been called.<br>';
25 }, false);
27 document.addEventListener('animationend', function(e) {
28 document.getElementById('result').innerHTML += 'PASS: animationend event listener has been called.';
29 if (window.testRunner)
30 testRunner.notifyDone();
31 }, false);
33 document.addEventListener('webkitAnimationEnd', function(e) {
34 document.getElementById('result').innerHTML += 'FAIL: webkitAnimationEnd event listener should not have been called.';
35 if (window.testRunner)
36 testRunner.notifyDone();
37 }, false);
39 </script>
40 </head>
41 <body>
42 Tests that custom events with unprefixed animations names are correctly dispatched.
43 <pre id="result"></pre>
44 </body>
45 <script>
46 var custom = document.createEvent('CustomEvent');
47 custom.initCustomEvent('animationstart', true, true, null);
48 document.dispatchEvent(custom);
49 custom = document.createEvent('CustomEvent');
50 custom.initCustomEvent('animationiteration', true, true, null);
51 document.dispatchEvent(custom);
52 custom = document.createEvent('CustomEvent');
53 custom.initCustomEvent('animationend', true, true, null);
54 document.dispatchEvent(custom);
55 </script>
56 </html>