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

Side by Side Diff: LayoutTests/css3/calc/transitions.html

Issue 15738009: Beat the transition tests with a sanity stick. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Pass presubmit. 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 <style> 2 <style>
3 .transitionTest { 3 .transitionTest {
4 background-color: green; 4 background-color: green;
5 height: 100px; 5 height: 100px;
6 -webkit-transition: all 1s linear; 6 -webkit-transition: all 1s linear;
7 -moz-transition: all 1s linear; 7 -moz-transition: all 1s linear;
8 } 8 }
9 9
10 #startCalcEndCalc, #startCalcEndPx, #startCalcEndPercent { 10 #startCalcEndCalc, #startCalcEndPx, #startCalcEndPercent {
(...skipping 26 matching lines...) Expand all
37 This tests that transitions containing calc() expressions transition correctly. 37 This tests that transitions containing calc() expressions transition correctly.
38 <div style="width:500px; border: 1px solid black;"> 38 <div style="width:500px; border: 1px solid black;">
39 <div class="transitionTest" id="startCalcEndCalc"></div> 39 <div class="transitionTest" id="startCalcEndCalc"></div>
40 <div class="transitionTest" id="startPxEndCalc"></div> 40 <div class="transitionTest" id="startPxEndCalc"></div>
41 <div class="transitionTest" id="startPercentEndCalc"></div> 41 <div class="transitionTest" id="startPercentEndCalc"></div>
42 <div class="transitionTest" id="startCalcEndPx"></div> 42 <div class="transitionTest" id="startCalcEndPx"></div>
43 <div class="transitionTest" id="startCalcEndPercent"></div> 43 <div class="transitionTest" id="startCalcEndPercent"></div>
44 </div> 44 </div>
45 <div id="result"></div> 45 <div id="result"></div>
46 46
47 <script src="../../transitions/resources/transition-test-helpers.js"></script> 47 <script src="../../animations/resources/animation-test-helpers.js"></script>
48 <script> 48 <script>
49 49
50 const tests = ["startCalcEndCalc", "startPxEndCalc", "startPercentEndCalc", "sta rtCalcEndPx", "startCalcEndPercent"]; 50 const tests = ["startCalcEndCalc", "startPxEndCalc", "startPercentEndCalc", "sta rtCalcEndPx", "startCalcEndPercent"];
51 51
52 expectedValues = []; 52 expectedValues = [];
53 53
54 for (var i = 0; i < tests.length; i++) { 54 for (var i = 0; i < tests.length; i++) {
55 expectedValues = expectedValues.concat([[0.25, tests[i], 'width', 175, 2]]); 55 expectedValues = expectedValues.concat([[0.25, tests[i], 'width', 175, 2]]);
56 expectedValues = expectedValues.concat([[0.5, tests[i], 'width', 250, 2]]); 56 expectedValues = expectedValues.concat([[0.5, tests[i], 'width', 250, 2]]);
57 expectedValues = expectedValues.concat([[0.75, tests[i], 'width', 325, 2]]); 57 expectedValues = expectedValues.concat([[0.75, tests[i], 'width', 325, 2]]);
58 expectedValues = expectedValues.concat([[1.0, tests[i], 'width', 400, 2]]); 58 expectedValues = expectedValues.concat([[1.0, tests[i], 'width', 400, 2]]);
59 } 59 }
60 60
61 function initialize(id) 61 function initialize(id)
62 { 62 {
63 var expectedStartWidth = 100; 63 var expectedStartWidth = 100;
64 var element = document.getElementById(id); 64 var element = document.getElementById(id);
65 var width = element.offsetWidth; 65 var width = element.offsetWidth;
66 if (width == expectedStartWidth) 66 if (width == expectedStartWidth)
67 element.innerHTML += 'PASS - "width" property for "' + id +'" element at 0.0s was: ' + width; 67 result += 'PASS - "width" property for "' + id +'" element at 0.0s was: ' + width + '<br>';
68 else 68 else
69 element.innerHTML += 'FAIL - "width" property for "' + id +'" element a t 0.0s expected: ' + expectedStartWidth + ' but saw: ' + width; 69 result += 'FAIL - "width" property for "' + id +'" element at 0.0s expe cted: ' + expectedStartWidth + ' but saw: ' + width + '<br>';
70 70
71 element.className += " go"; 71 element.className += " go";
72 } 72 }
73 73
74 function setupTest() 74 function setupTest()
75 { 75 {
76 for (var i = 0; i < tests.length; i++) 76 for (var i = 0; i < tests.length; i++)
77 initialize(tests[i]); 77 initialize(tests[i]);
78 } 78 }
79 79
80 runTransitionTest(expectedValues, setupTest, true, false /* pixel test */); 80 runTransitionTest(expectedValues, setupTest, true, false /* pixel test */);
81 81
82 </script> 82 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698