| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
| 5 <!-- | 5 <!-- |
| 6 Touch tests that involve the ontouchstart, ontouchmove, ontouchend or ontouchc
ancel callbacks | 6 Touch tests that involve the ontouchstart, ontouchmove, ontouchend or ontouchc
ancel callbacks |
| 7 should be written in an asynchronous fashion so they can be run on mobile plat
forms like Android. | 7 should be written in an asynchronous fashion so they can be run on mobile plat
forms like Android. |
| 8 You will need to invoke isSuccessfullyParsed() in your test script when the te
st completes. | 8 You will need to invoke isSuccessfullyParsed() in your test script when the te
st completes. |
| 9 --> | 9 --> |
| 10 </head> | 10 </head> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 div.addEventListener("touchmove", touchEventCallback, false); | 43 div.addEventListener("touchmove", touchEventCallback, false); |
| 44 div.addEventListener("touchend", touchEventCallback, false); | 44 div.addEventListener("touchend", touchEventCallback, false); |
| 45 document.body.insertBefore(div, document.body.firstChild); | 45 document.body.insertBefore(div, document.body.firstChild); |
| 46 | 46 |
| 47 function verifyTouchEvent(type, totalTouchCount, changedTouchCount, targetTouchC
ount) | 47 function verifyTouchEvent(type, totalTouchCount, changedTouchCount, targetTouchC
ount) |
| 48 { | 48 { |
| 49 shouldBeEqualToString("lastEvent.type", type); | 49 shouldBeEqualToString("lastEvent.type", type); |
| 50 shouldBe("lastEvent.touches.length", totalTouchCount.toString()); | 50 shouldBe("lastEvent.touches.length", totalTouchCount.toString()); |
| 51 shouldBe("lastEvent.changedTouches.length", changedTouchCount.toString()); | 51 shouldBe("lastEvent.changedTouches.length", changedTouchCount.toString()); |
| 52 shouldBe("lastEvent.targetTouches.length", targetTouchCount.toString()); | 52 shouldBe("lastEvent.targetTouches.length", targetTouchCount.toString()); |
| 53 shouldBeTrue("lastEvent.composed"); |
| 53 } | 54 } |
| 54 | 55 |
| 55 function verifyTouchPoint(list, point, x, y, id, rx, ry) | 56 function verifyTouchPoint(list, point, x, y, id, rx, ry) |
| 56 { | 57 { |
| 57 shouldBe("lastEvent." + list + "[" + point + "].pageX", x.toString()); | 58 shouldBe("lastEvent." + list + "[" + point + "].pageX", x.toString()); |
| 58 shouldBe("lastEvent." + list + "[" + point + "].pageY", y.toString()); | 59 shouldBe("lastEvent." + list + "[" + point + "].pageY", y.toString()); |
| 59 shouldBe("lastEvent." + list + "[" + point + "].clientX", x.toString()); | 60 shouldBe("lastEvent." + list + "[" + point + "].clientX", x.toString()); |
| 60 shouldBe("lastEvent." + list + "[" + point + "].clientY", y.toString()); | 61 shouldBe("lastEvent." + list + "[" + point + "].clientY", y.toString()); |
| 61 shouldBe("lastEvent." + list + "[" + point + "].identifier", id.toString()); | 62 shouldBe("lastEvent." + list + "[" + point + "].identifier", id.toString()); |
| 62 if (eventSender.setTouchPointRadius) { | 63 if (eventSender.setTouchPointRadius) { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 lastEvent = null; | 146 lastEvent = null; |
| 146 eventSender.clearTouchPoints(); | 147 eventSender.clearTouchPoints(); |
| 147 touchTargets(); | 148 touchTargets(); |
| 148 | 149 |
| 149 } else { | 150 } else { |
| 150 debug("This test requires DumpRenderTree. Tap on the blue rect to log.") | 151 debug("This test requires DumpRenderTree. Tap on the blue rect to log.") |
| 151 } | 152 } |
| 152 </script> | 153 </script> |
| 153 </body> | 154 </body> |
| 154 </html> | 155 </html> |
| OLD | NEW |