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

Side by Side Diff: third_party/WebKit/LayoutTests/animations/animation-events-prefixed-01.html

Issue 2411163003: CSS Animations: Reduce usage of setTimeout in Layout tests (Closed)
Patch Set: extra tests Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/animations/animation-events-unprefixed-02.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Tests that prefixed animation events are correctly fired.</title> 4 <title>Tests that prefixed animation events are correctly fired.</title>
5 <style> 5 <style>
6 #box { 6 #box {
7 position: relative; 7 position: relative;
8 left: 100px; 8 left: 100px;
9 top: 10px; 9 top: 10px;
10 height: 100px; 10 height: 100px;
(...skipping 29 matching lines...) Expand all
40 document.getElementById('result').innerHTML = 'PASS: All events have bee n received as expected.'; 40 document.getElementById('result').innerHTML = 'PASS: All events have bee n received as expected.';
41 if (window.testRunner) 41 if (window.testRunner)
42 testRunner.notifyDone(); 42 testRunner.notifyDone();
43 } 43 }
44 }, false); 44 }, false);
45 45
46 document.addEventListener('webkitAnimationEnd', function() { 46 document.addEventListener('webkitAnimationEnd', function() {
47 endEventReceived = true; 47 endEventReceived = true;
48 document.getElementById('box').className = ''; 48 document.getElementById('box').className = '';
49 // Launch again the animation to catch the animation iteration events this time. 49 // Launch again the animation to catch the animation iteration events this time.
50 setTimeout(function () { 50 requestAnimationFrame(function () {
51 document.getElementById('box').style.webkitAnimationIterationCount = "in finite"; 51 document.getElementById('box').style.webkitAnimationIterationCount = "in finite";
52 document.getElementById('box').className = 'animate'; 52 document.getElementById('box').className = 'animate';
53 }, 200); 53 });
54 }, false); 54 }, false);
55 55
56 onload = function() 56 onload = function()
57 { 57 {
58 // Animation begins once we append the DOM node to the document. 58 // Animation begins once we append the DOM node to the document.
59 var boxNode = document.createElement('div'); 59 var boxNode = document.createElement('div');
60 boxNode.id = 'box'; 60 boxNode.id = 'box';
61 boxNode.className = 'animate'; 61 boxNode.className = 'animate';
62 document.body.appendChild(boxNode); 62 document.body.appendChild(boxNode);
63 } 63 }
64 </script> 64 </script>
65 </head> 65 </head>
66 <body> 66 <body>
67 Tests that prefixed animation events are correctly fired. 67 Tests that prefixed animation events are correctly fired.
68 <pre id="result">FAIL: No animation events received</pre> 68 <pre id="result">FAIL: No animation events received</pre>
69 </body> 69 </body>
70 </html> 70 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/animations/animation-events-unprefixed-02.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698