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

Side by Side Diff: LayoutTests/fast/css-generated-content/pseudo-animation.html

Issue 14556022: Simplify animation testing API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 2
3 <script src="../js/resources/js-test-pre.js"></script> 3 <script src="../js/resources/js-test-pre.js"></script>
4 4
5 <style> 5 <style>
6 @-webkit-keyframes example { 6 @-webkit-keyframes example {
7 from { 7 from {
8 width: 50px; 8 width: 50px;
9 height: 50px; 9 height: 50px;
10 top: 50px; 10 top: 50px;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // FIXME: This test should be modified so subpixel doesn't cause off by one 78 // FIXME: This test should be modified so subpixel doesn't cause off by one
79 // below and it no longer needs shouldBeCloseTo. 79 // below and it no longer needs shouldBeCloseTo.
80 80
81 function testAnimation(id) 81 function testAnimation(id)
82 { 82 {
83 var div = document.getElementById(id); 83 var div = document.getElementById(id);
84 div.className = 'animate'; 84 div.className = 'animate';
85 window.div = div; 85 window.div = div;
86 shouldBe('div.offsetWidth', '52'); 86 shouldBe('div.offsetWidth', '52');
87 if (window.internals) { 87 if (window.internals) {
88 internals.pauseAnimationAtTimeOnPseudoElement('example', 1.0, div, id); 88 internals.pauseAnimations(1);
89 shouldBeCloseTo('div.offsetWidth', 20, 1); 89 shouldBeCloseTo('div.offsetWidth', 20, 1);
90 computedTop = getPseudoComputedTop(id); 90 computedTop = getPseudoComputedTop(id);
91 shouldBeCloseTo('computedTop', 170, 1); 91 shouldBeCloseTo('computedTop', 170, 1);
92 internals.pauseAnimationAtTimeOnPseudoElement('example', 2.0, div, id); 92 internals.pauseAnimations(2);
93 shouldBeCloseTo('div.offsetWidth', 12, 1); 93 shouldBeCloseTo('div.offsetWidth', 12, 1);
94 computedTop = getPseudoComputedTop(id); 94 computedTop = getPseudoComputedTop(id);
95 shouldBeCloseTo('computedTop', 200, 1); 95 shouldBeCloseTo('computedTop', 200, 1);
96 } else { 96 } else {
97 // This will be flaky, but it's a reasonable approximation for testing 97 // This will be flaky, but it's a reasonable approximation for testing
98 // in a browser instead of DRT. 98 // in a browser instead of DRT.
99 setTimeout(function() { 99 setTimeout(function() {
100 window.div = div; 100 window.div = div;
101 shouldBeCloseTo('div.offsetWidth', 20, 1); 101 shouldBeCloseTo('div.offsetWidth', 20, 1);
102 computedTop = getPseudoComputedTop(id); 102 computedTop = getPseudoComputedTop(id);
(...skipping 10 matching lines...) Expand all
113 113
114 onload = function() { 114 onload = function() {
115 testAnimation('before'); 115 testAnimation('before');
116 testAnimation('after'); 116 testAnimation('after');
117 if (window.internals) 117 if (window.internals)
118 isSuccessfullyParsed(); 118 isSuccessfullyParsed();
119 else 119 else
120 setTimeout(isSuccessfullyParsed, 2000); 120 setTimeout(isSuccessfullyParsed, 2000);
121 }; 121 };
122 </script> 122 </script>
OLDNEW
« no previous file with comments | « LayoutTests/css3/calc/transitions-dependent.html ('k') | LayoutTests/fast/css-generated-content/pseudo-transition.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698