1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../../../resources/js-test.js"></script>
9 function touchHandler(e
) {
10 var touch
= e
.touches
[0];
11 radiusX
= touch
.radiusX
;
12 radiusY
= touch
.radiusY
;
17 isSuccessfullyParsed();
18 testRunner
.notifyDone();
21 function sendTouchStart(x
, y
, radiusX
, radiusY
)
23 eventSender
.clearTouchPoints();
24 eventSender
.addTouchPoint(x
, y
, radiusX
, radiusY
);
25 eventSender
.touchStart();
29 if (window
.testRunner
)
30 testRunner
.waitUntilDone();
32 if (window
.eventSender
) {
33 description("This tests makes sure the touch event's radius "
34 + "property is scaled to account for browser zoom.");
36 document
.body
.addEventListener("touchstart", touchHandler
);
38 debug("===Initial Zoom===");
39 sendTouchStart(100, 100, 4, 10);
40 shouldBe("radiusX", "4");
41 shouldBe("radiusY", "10");
43 window
.internals
.setZoomFactor(2.0);
45 debug("===Zoom 2X===");
46 sendTouchStart(100, 100, 4, 10);
47 shouldBe("radiusX", "2");
48 shouldBe("radiusY", "5");
50 window
.internals
.setZoomFactor(0.5);
52 debug("===Zoom 0.5X===");
53 sendTouchStart(100, 100, 4, 10);
54 shouldBe("radiusX", "8");
55 shouldBe("radiusY", "20");
60 debug("This test requires DumpRenderTree. Tap on the blue rect to log.")
66 <body onload=
"runTest()">
67 <div id=
"console"></div>