OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="resources/target-div-run-test.js"></script> | 4 <script src="resources/target-div-run-test.js"></script> |
5 <script src="resources/link-highlight-helper.js"></script> | 5 <script src="resources/link-highlight-helper.js"></script> |
6 <link rel="stylesheet" type="text/css" href="resources/link-highlight-style.css"
> | 6 <link rel="stylesheet" type="text/css" href="resources/link-highlight-style.css"
> |
7 </head> | 7 </head> |
8 <body onload="runTest();"> | 8 <body onload="runTest();"> |
9 <div style="top: 10px; left: 10px; -webkit-transform: translateZ(0);"> | 9 <div style="top: 10px; left: 10px; transform: translateZ(0);"> |
10 <div class="opaqueHighlight" id="targetDiv" style="position: static; left: 50px;
top: 50px; width: 50px; height: 50px; box-shadow: 0px 4px 23px 5px rgba(0, 0, 0
, 0.2); border-style: solid; border-width: 2px; cursor: Pointer"> | 10 <div class="opaqueHighlight" id="targetDiv" style="position: static; left: 50px;
top: 50px; width: 50px; height: 50px; box-shadow: 0px 4px 23px 5px rgba(0, 0, 0
, 0.2); border-style: solid; border-width: 2px; cursor: Pointer"> |
11 <br><center>Target</center><br> | 11 <br><center>Target</center><br> |
12 </div> | 12 </div> |
13 </div> | 13 </div> |
14 <div style="position: absolute; left: 10px; top: 250px; -webkit-transform: trans
lateZ(0);"> | 14 <div style="position: absolute; left: 10px; top: 250px; transform: translateZ(0)
;"> |
15 This test is successful if the box labelled "Target" has a green rectangle cente
red on it. | 15 This test is successful if the box labelled "Target" has a green rectangle cente
red on it. |
16 </div> | 16 </div> |
17 <script> | 17 <script> |
18 function runTest() { | 18 function runTest() { |
19 useMockHighlight(); | 19 useMockHighlight(); |
20 | 20 |
21 var clientRect = document.getElementById('targetDiv').getBoundingClientRect(
); | 21 var clientRect = document.getElementById('targetDiv').getBoundingClientRect(
); |
22 x = (clientRect.left + clientRect.right) / 2; | 22 x = (clientRect.left + clientRect.right) / 2; |
23 y = (clientRect.top + clientRect.bottom) / 2; | 23 y = (clientRect.top + clientRect.bottom) / 2; |
24 if (window.testRunner) { | 24 if (window.testRunner) { |
25 testRunner.dumpAsTextWithPixelResults(); | 25 testRunner.dumpAsTextWithPixelResults(); |
26 testRunner.waitUntilDone(); | 26 testRunner.waitUntilDone(); |
27 } | 27 } |
28 | 28 |
29 if (window.eventSender) { | 29 if (window.eventSender) { |
30 eventSender.gestureShowPress(x, y); | 30 eventSender.gestureShowPress(x, y); |
31 window.setTimeout(function() { window.testRunner.notifyDone(); }, 0); | 31 window.setTimeout(function() { window.testRunner.notifyDone(); }, 0); |
32 } else { | 32 } else { |
33 debug("This test requires DumpRenderTree."); | 33 debug("This test requires DumpRenderTree."); |
34 } | 34 } |
35 } | 35 } |
36 </script> | 36 </script> |
37 </script> | 37 </script> |
38 </body> | 38 </body> |
39 </html> | 39 </html> |
OLD | NEW |