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

Side by Side Diff: LayoutTests/transitions/transition-hit-test-transform.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 2
3 <html> 3 <html>
4 <head> 4 <head>
5 <style> 5 <style>
6 #target { 6 #target {
7 position: absolute; 7 position: absolute;
8 left: 0px; 8 left: 0px;
9 height: 200px; 9 height: 200px;
10 width: 200px; 10 width: 200px;
11 background-color: red; 11 background-color: red;
12 -webkit-transform: translateX(100px); 12 -webkit-transform: translateX(100px);
13 -webkit-transition-property: -webkit-transform; 13 -webkit-transition-property: -webkit-transform;
14 -webkit-transition-duration: 4s; 14 -webkit-transition-duration: 4s;
15 -webkit-transition-timing-function: linear; 15 -webkit-transition-timing-function: linear;
16 } 16 }
17 17
18 .dot { 18 .dot {
19 width: 10px; 19 width: 10px;
20 height: 10px; 20 height: 10px;
21 top: 100px; 21 top: 100px;
22 background-color: yellow; 22 background-color: yellow;
23 position:absolute; 23 position:absolute;
24 } 24 }
25 </style> 25 </style>
26 <script src="resources/transition-test-helpers.js"></script> 26 <script src="../animations/resources/animation-test-helpers.js"></script>
27 <script type="text/javascript"> 27 <script type="text/javascript">
28 function checkResult(pos, isIn) 28 function checkResult(pos, isIn)
29 { 29 {
30 var elt = document.elementFromPoint(pos, 150); 30 var elt = document.elementFromPoint(pos, 150);
31 var good = isIn ? "inside" : "outside"; 31 var good = isIn ? "inside" : "outside";
32 var bad = isIn ? "outside" : "inside"; 32 var bad = isIn ? "outside" : "inside";
33 return (isIn == (elt.id == "target")) ? 33 return (isIn == (elt.id == "target")) ?
34 "<span style='color:green'>PASS</span> - " + pos + "px was " + g ood + " as it should be" + "<br>" : 34 "<span style='color:green'>PASS</span> - " + pos + "px was " + g ood + " as it should be" + "<br>" :
35 "<span style='color:red'>FAIL</span> - " + pos + "px was " + bad + " and should have been " + good + "<br>"; 35 "<span style='color:red'>FAIL</span> - " + pos + "px was " + bad + " and should have been " + good + "<br>";
36 } 36 }
(...skipping 23 matching lines...) Expand all
60 } 60 }
61 61
62 function startTest() 62 function startTest()
63 { 63 {
64 if (window.testRunner) { 64 if (window.testRunner) {
65 testRunner.dumpAsText(); 65 testRunner.dumpAsText();
66 testRunner.waitUntilDone(); 66 testRunner.waitUntilDone();
67 } 67 }
68 68
69 document.getElementById("target").style.webkitTransform = "translate X(300px)"; 69 document.getElementById("target").style.webkitTransform = "translate X(300px)";
70 waitForAnimationStart(doTest); 70 requestAnimationFrame(doTest);
71 } 71 }
72 </script> 72 </script>
73 </head> 73 </head>
74 <body onload="startTest()"> 74 <body onload="startTest()">
75 <div> 75 <div>
76 This test starts a transition of the '-webkit-transform' property and th en does elementFromPoint calls 76 This test starts a transition of the '-webkit-transform' property and th en does elementFromPoint calls
77 at the shown yellow dots to see if hit testing works 77 at the shown yellow dots to see if hit testing works
78 </div> 78 </div>
79 <div id="target"></div> 79 <div id="target"></div>
80 <div class="dot" style="left:150px"></div> 80 <div class="dot" style="left:150px"></div>
81 <div class="dot" style="left:300px"></div> 81 <div class="dot" style="left:300px"></div>
82 <div class="dot" style="left:450px"></div> 82 <div class="dot" style="left:450px"></div>
83 <div id="result"></div> 83 <div id="result"></div>
84 </body> 84 </body>
85 </html> 85 </html>
OLDNEW
« no previous file with comments | « LayoutTests/transitions/transition-end-event-rendering.html ('k') | LayoutTests/transitions/transition-in-delay-phase.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698