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

Side by Side Diff: LayoutTests/animations/fill-mode.html

Issue 707713005: Don't require getPropertyCSSValue in animation fill-mode tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 | LayoutTests/animations/fill-mode-iteration-count-non-integer.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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd"> 2 "http://www.w3.org/TR/html4/loose.dtd">
3 3
4 <html lang="en"> 4 <html lang="en">
5 <head> 5 <head>
6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
7 <title>Test simple animation with fill modes</title> 7 <title>Test simple animation with fill modes</title>
8 <style type="text/css" media="screen"> 8 <style type="text/css" media="screen">
9 .box { 9 .box {
10 position: relative; 10 position: relative;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 setTimeout(endTest, 0); // this set timeout should be ok in the test environment 67 setTimeout(endTest, 0); // this set timeout should be ok in the test environment
68 // since we're just giving style a chance to resolve 68 // since we're just giving style a chance to resolve
69 } 69 }
70 }; 70 };
71 71
72 function endTest() { 72 function endTest() {
73 73
74 for (var i=0; i < expectedValues.length; i++) { 74 for (var i=0; i < expectedValues.length; i++) {
75 var el = document.getElementById(expectedValues[i].id); 75 var el = document.getElementById(expectedValues[i].id);
76 var expectedValue = expectedValues[i].end; 76 var expectedValue = expectedValues[i].end;
77 var realValue = window.getComputedStyle(el).getPropertyCSSValue("lef t").getFloatValue(CSSPrimitiveValue.CSS_NUMBER); 77 var realValue = parseFloat(window.getComputedStyle(el).left);
78 if (Math.abs(expectedValue - realValue) < allowance) { 78 if (Math.abs(expectedValue - realValue) < allowance) {
79 result += "PASS"; 79 result += "PASS";
80 } else { 80 } else {
81 result += "FAIL"; 81 result += "FAIL";
82 } 82 }
83 result += " - end of animation - id: " + expectedValues[i].id + " ex pected: " + expectedValue + " actual: " + realValue + "<br>"; 83 result += " - end of animation - id: " + expectedValues[i].id + " ex pected: " + expectedValue + " actual: " + realValue + "<br>";
84 } 84 }
85 document.getElementById('result').innerHTML = result; 85 document.getElementById('result').innerHTML = result;
86 86
87 if (window.testRunner) 87 if (window.testRunner)
88 testRunner.notifyDone(); 88 testRunner.notifyDone();
89 } 89 }
90 90
91 window.onload = function () { 91 window.onload = function () {
92 for (var i=0; i < expectedValues.length; i++) { 92 for (var i=0; i < expectedValues.length; i++) {
93 var el = document.getElementById(expectedValues[i].id); 93 var el = document.getElementById(expectedValues[i].id);
94 var expectedValue = expectedValues[i].start; 94 var expectedValue = expectedValues[i].start;
95 var realValue = window.getComputedStyle(el).getPropertyCSSValue("lef t").getFloatValue(CSSPrimitiveValue.CSS_NUMBER); 95 var realValue = parseFloat(window.getComputedStyle(el).left);
96 if (Math.abs(expectedValue - realValue) < allowance) { 96 if (Math.abs(expectedValue - realValue) < allowance) {
97 result += "PASS"; 97 result += "PASS";
98 } else { 98 } else {
99 result += "FAIL"; 99 result += "FAIL";
100 } 100 }
101 result += " - start of animation - id: " + expectedValues[i].id + " expected: " + expectedValue + " actual: " + realValue + "<br>"; 101 result += " - start of animation - id: " + expectedValues[i].id + " expected: " + expectedValue + " actual: " + realValue + "<br>";
102 } 102 }
103 document.addEventListener("webkitAnimationEnd", animationEnded, false); 103 document.addEventListener("webkitAnimationEnd", animationEnded, false);
104 }; 104 };
105 105
(...skipping 15 matching lines...) Expand all
121 <div id="d" class="box"> 121 <div id="d" class="box">
122 Both 122 Both
123 </div> 123 </div>
124 <div id="e" class="box"> 124 <div id="e" class="box">
125 Both iterating 125 Both iterating
126 </div> 126 </div>
127 <div id="result"> 127 <div id="result">
128 </div> 128 </div>
129 </body> 129 </body>
130 </html> 130 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/animations/fill-mode-iteration-count-non-integer.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698