Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Unified Diff: LayoutTests/virtual/stable/animations-unprefixed/animation-events-prefixed-04.html

Issue 263553010: Make sure we correctly dispatch custom events having the same names as unprefixed animations events (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/virtual/stable/animations-unprefixed/animation-events-prefixed-04.html
diff --git a/LayoutTests/virtual/stable/animations-unprefixed/animation-events-prefixed-04.html b/LayoutTests/virtual/stable/animations-unprefixed/animation-events-prefixed-04.html
new file mode 100644
index 0000000000000000000000000000000000000000..d8748aeff022c52556448a2e4df3dc3811ae9514
--- /dev/null
+++ b/LayoutTests/virtual/stable/animations-unprefixed/animation-events-prefixed-04.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Tests that custom events with prefixed animations names are correctly dispatched.</title>
+ <script>
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ document.addEventListener('animationstart', function(e) {
+ document.getElementById('result').innerHTML += 'FAIL: animationstart event listener should not have been called.<br>';
+ }, false);
+
+ document.addEventListener('webkitAnimationStart', function(e) {
+ document.getElementById('result').innerHTML += 'PASS: webkitAnimationStart event listener has been called.<br>';
+ }, false);
+
+ document.addEventListener('animationiteration', function(e) {
+ document.getElementById('result').innerHTML += 'FAIL: animationiteration event listener should not have been called.<br>';
+ }, false);
+
+ document.addEventListener('webkitAnimationIteration', function(e) {
+ document.getElementById('result').innerHTML += 'PASS: webkitAnimationIteration event listener has been called.<br>';
+ }, false);
+
+ document.addEventListener('animationend', function(e) {
+ document.getElementById('result').innerHTML += 'FAIL: animationend event listener should not have been called.';
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }, false);
+
+ document.addEventListener('webkitAnimationEnd', function(e) {
+ document.getElementById('result').innerHTML += 'PASS: webkitAnimationEnd event has been called.';
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }, false);
+
+ </script>
+</head>
+<body>
+Tests that custom events with prefixed animations names are correctly dispatched.
+<pre id="result"></pre>
+</body>
+<script>
+ var custom = document.createEvent('CustomEvent');
+ custom.initCustomEvent('webkitAnimationStart', true, true);
+ document.dispatchEvent(custom);
+ custom = document.createEvent('CustomEvent');
+ custom.initCustomEvent('webkitAnimationIteration', true, true);
+ document.dispatchEvent(custom);
+ custom = document.createEvent('CustomEvent');
+ custom.initCustomEvent('webkitAnimationEnd', true, true);
+ document.dispatchEvent(custom);
+</script>
+</html>

Powered by Google App Engine
This is Rietveld 408576698