OLD | NEW |
1 var div = document.createElement("div"); | 1 var div = document.createElement("div"); |
2 div.id = "touchtarget"; | 2 div.id = "touchtarget"; |
3 div.style.width = "100px"; | 3 div.style.width = "100px"; |
4 div.style.height = "100px"; | 4 div.style.height = "100px"; |
5 div.style.backgroundColor = "blue"; | 5 div.style.backgroundColor = "blue"; |
6 | 6 |
7 var lastEvent = null; | 7 var lastEvent = null; |
8 var touchEventsReceived = 0; | 8 var touchEventsReceived = 0; |
9 var EXPECTED_TOUCH_EVENTS_TOTAL = 5; | 9 var EXPECTED_TOUCH_EVENTS_TOTAL = 5; |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 div.addEventListener("touchmove", touchEventCallback, false); | 29 div.addEventListener("touchmove", touchEventCallback, false); |
30 div.addEventListener("touchend", touchEventCallback, false); | 30 div.addEventListener("touchend", touchEventCallback, false); |
31 document.body.insertBefore(div, document.body.firstChild); | 31 document.body.insertBefore(div, document.body.firstChild); |
32 | 32 |
33 function verifyTouchEvent(type, totalTouchCount, changedTouchCount, targetTouchC
ount) | 33 function verifyTouchEvent(type, totalTouchCount, changedTouchCount, targetTouchC
ount) |
34 { | 34 { |
35 shouldBeEqualToString("lastEvent.type", type); | 35 shouldBeEqualToString("lastEvent.type", type); |
36 shouldBe("lastEvent.touches.length", totalTouchCount.toString()); | 36 shouldBe("lastEvent.touches.length", totalTouchCount.toString()); |
37 shouldBe("lastEvent.changedTouches.length", changedTouchCount.toString()); | 37 shouldBe("lastEvent.changedTouches.length", changedTouchCount.toString()); |
38 shouldBe("lastEvent.targetTouches.length", targetTouchCount.toString()); | 38 shouldBe("lastEvent.targetTouches.length", targetTouchCount.toString()); |
39 shouldBe("lastEvent.pageX", "0"); | |
40 shouldBe("lastEvent.pageY", "0"); | |
41 } | 39 } |
42 | 40 |
43 function verifyTouchPoint(list, point, x, y, id, rx, ry) | 41 function verifyTouchPoint(list, point, x, y, id, rx, ry) |
44 { | 42 { |
45 shouldBe("lastEvent." + list + "[" + point + "].pageX", x.toString()); | 43 shouldBe("lastEvent." + list + "[" + point + "].pageX", x.toString()); |
46 shouldBe("lastEvent." + list + "[" + point + "].pageY", y.toString()); | 44 shouldBe("lastEvent." + list + "[" + point + "].pageY", y.toString()); |
47 shouldBe("lastEvent." + list + "[" + point + "].clientX", x.toString()); | 45 shouldBe("lastEvent." + list + "[" + point + "].clientX", x.toString()); |
48 shouldBe("lastEvent." + list + "[" + point + "].clientY", y.toString()); | 46 shouldBe("lastEvent." + list + "[" + point + "].clientY", y.toString()); |
49 shouldBe("lastEvent." + list + "[" + point + "].identifier", id.toString()); | 47 shouldBe("lastEvent." + list + "[" + point + "].identifier", id.toString()); |
50 if (eventSender.setTouchPointRadius) { | 48 if (eventSender.setTouchPointRadius) { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 130 |
133 lastEvent = null; | 131 lastEvent = null; |
134 eventSender.clearTouchPoints(); | 132 eventSender.clearTouchPoints(); |
135 touchTargets(); | 133 touchTargets(); |
136 | 134 |
137 } else { | 135 } else { |
138 debug("This test requires DumpRenderTree. Tap on the blue rect to log.") | 136 debug("This test requires DumpRenderTree. Tap on the blue rect to log.") |
139 } | 137 } |
140 | 138 |
141 | 139 |
OLD | NEW |