[iOS] Add iOS-specific tests and consolidate iOS-specific accessibility tests
[WebKit-https.git] / LayoutTests / platform / ios-simulator / ios / fast / events / touch / script-tests / input-touch-target.js
1 var target = document.createElement('input');
2 target.setAttribute('type', 'text');
3 target.id = "target";
4 target.setAttribute('style', "position: absolute; top: 0; left: 0; font-size: 24px;");
5
6 document.body.insertBefore(target, document.getElementById('console'));
7
8 function touchStartHandler()
9 {
10     shouldBeEqualToString('event.type', 'touchstart');
11     shouldBeEqualToString('event.touches[0].target.id', target.id);
12     shouldBeEqualToString('event.touches[0].target.nodeName', 'INPUT');
13
14     successfullyParsed = true;
15     isSuccessfullyParsed();
16 }
17
18 target.addEventListener("touchstart", touchStartHandler, false);
19
20 description("Tests that input elements can receive touch events.");
21
22 if (window.eventSender) {
23     eventSender.clearTouchPoints();
24     eventSender.addTouchPoint(10, 10);
25     eventSender.touchStart();
26     eventSender.touchEnd();
27 } else
28     debug('This test requires DRT.');
29
30 document.body.removeChild(target);
31
32 var successfullyParsed = true;