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

Side by Side Diff: LayoutTests/fast/css-generated-content/pseudo-transition.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 #before:before, 6 #before:before,
7 #after:after { 7 #after:after {
8 content: ""; 8 content: "";
9 display: block; 9 display: block;
10 height: 50px; 10 height: 50px;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 // FIXME: This test should be modified so subpixel doesn't cause off by one 53 // FIXME: This test should be modified so subpixel doesn't cause off by one
54 // below and it no longer needs shouldBeCloseTo. 54 // below and it no longer needs shouldBeCloseTo.
55 55
56 function testTransition(id) 56 function testTransition(id)
57 { 57 {
58 var div = document.getElementById(id); 58 var div = document.getElementById(id);
59 div.className = 'transition'; 59 div.className = 'transition';
60 window.div = div; 60 window.div = div;
61 shouldBe('div.offsetWidth', '52'); 61 shouldBe('div.offsetWidth', '52');
62 if (window.internals) { 62 if (window.internals) {
63 internals.pauseTransitionAtTimeOnPseudoElement('width', 1.0, div, id); 63 internals.pauseAnimations(1);
64 shouldBeCloseTo('div.offsetWidth', 20, 1); 64 shouldBeCloseTo('div.offsetWidth', 20, 1);
65 internals.pauseTransitionAtTimeOnPseudoElement('top', 1.0, div, id);
66 computedTop = getPseudoComputedTop(id); 65 computedTop = getPseudoComputedTop(id);
67 shouldBeCloseTo('computedTop', 170, 1); 66 shouldBeCloseTo('computedTop', 170, 1);
68 internals.pauseTransitionAtTimeOnPseudoElement('width', 2.0, div, id); 67 internals.pauseAnimations(2);
69 shouldBeCloseTo('div.offsetWidth', 12, 1); 68 shouldBeCloseTo('div.offsetWidth', 12, 1);
70 internals.pauseTransitionAtTimeOnPseudoElement('top', 2.0, div, id);
71 computedTop = getPseudoComputedTop(id); 69 computedTop = getPseudoComputedTop(id);
72 shouldBeCloseTo('computedTop', 200, 1); 70 shouldBeCloseTo('computedTop', 200, 1);
73 } else { 71 } else {
74 // This will be flaky, but it's a reasonable approximation for testing 72 // This will be flaky, but it's a reasonable approximation for testing
75 // in a browser instead of DRT. 73 // in a browser instead of DRT.
76 setTimeout(function() { 74 setTimeout(function() {
77 window.div = div; 75 window.div = div;
78 shouldBeCloseTo('div.offsetWidth', 20, 1); 76 shouldBeCloseTo('div.offsetWidth', 20, 1);
79 computedTop = getPseudoComputedTop(id); 77 computedTop = getPseudoComputedTop(id);
80 shouldBeCloseTo('computedTop', 170, 1); 78 shouldBeCloseTo('computedTop', 170, 1);
81 }, 1000); 79 }, 1000);
82 setTimeout(function() { 80 setTimeout(function() {
83 window.div = div; 81 window.div = div;
84 shouldBeCloseTo('div.offsetWidth', 12, 1); 82 shouldBeCloseTo('div.offsetWidth', 12, 1);
85 computedTop = getPseudoComputedTop(id); 83 computedTop = getPseudoComputedTop(id);
86 shouldBeCloseTo('computedTop', 200, 1); 84 shouldBeCloseTo('computedTop', 200, 1);
87 }, 2000); 85 }, 2000);
88 } 86 }
89 } 87 }
90 88
91 onload = function() { 89 onload = function() {
92 testTransition('before'); 90 testTransition('before');
93 testTransition('after'); 91 testTransition('after');
94 if (window.internals) 92 if (window.internals)
95 isSuccessfullyParsed(); 93 isSuccessfullyParsed();
96 else 94 else
97 setTimeout(isSuccessfullyParsed, 2000); 95 setTimeout(isSuccessfullyParsed, 2000);
98 }; 96 };
99 </script> 97 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698