blob: d87c2937b6ea23aa3d99137e1faf67863d9ca5eb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test.js"></script>
<link rel="stylesheet" type="text/css" href="resources/link-highlight-style.css">
</head>
<body onload="runTest();">
<div style="transform: translateZ(0); position: relative; left: 10; top: 40">
<a class="opaqueHighlight" href="" id="targetLink">Long Target<br>Link.</a>
</div>
<div style="position: relative; left: 10; top: 70">
This test is successful if "Long Target Link" above is covered in two green rectangles with square corners.
</div>
<script>
function runTest() {
var clientRect = document.getElementById('targetLink').getBoundingClientRect();
x = (clientRect.left + clientRect.right) / 2;
y = (clientRect.top + clientRect.bottom) / 2;
touchWidth = (clientRect.right - clientRect.left) / 4;
touchHeight = (clientRect.bottom - clientRect.top) / 4;
if (window.testRunner) {
testRunner.dumpAsTextWithPixelResults();
testRunner.waitUntilDone();
}
if (window.eventSender) {
eventSender.gestureShowPress(x, y, touchWidth, touchHeight);
window.setTimeout(function() { window.testRunner.notifyDone(); }, 0);
} else {
debug("This test requires DumpRenderTree.");
}
}
</script>
</script>
</body>
</html>
|