2 <script src=
"../../../../resources/js-test.js"></script>
10 <div id=console
></div>
22 var eventReceived
= {};
25 debug("Received " + e
.type
+ " in page");
27 eventReceived
[e
.type
] = true;
28 shouldBe("event.screenX", "point.x");
29 shouldBe("event.screenY", "point.y");
30 shouldBe("event.clientX", "point.x");
31 shouldBe("event.clientY", "point.y");
32 shouldBe("event.pageX", "point.x + scrollOffset.x");
33 shouldBe("event.pageY", "point.y + scrollOffset.y");
36 var eventTypes
= ['mousemove', 'mousedown', 'mouseup', 'click'];
37 for (var i
= 0; i
< eventTypes
.length
; i
++)
38 document
.addEventListener(eventTypes
[i
],onEvent
);
40 description("Verifies that a tap occuring in a scrolled page has the correct co-ordinates");
42 if (window
.eventSender
) {
44 window
.onload = function() {
45 window
.scrollTo(scrollOffset
.x
, scrollOffset
.y
);
47 debug("Sending GestureTapDown to " + point
.x
+ "," + point
.y
);
48 eventSender
.gestureTapDown(point
.x
, point
.y
);
50 debug("Sending GestureShowPress");
51 eventSender
.gestureShowPress(point
.x
, point
.y
);
53 debug("Sending GestureTap");
54 eventSender
.gestureTap(point
.x
, point
.y
);
56 shouldBeTrue("eventReceived.mousemove");
57 shouldBeTrue("eventReceived.mousedown");
58 shouldBeTrue("eventReceived.mouseup");
59 shouldBeTrue("eventReceived.click");
60 setTimeout(finishJSTest
, 100);
63 debug("This test requires eventSender");