Web Inspector: Do not dispatch mousemove when emulating touch event and no touch...
[WebKit-https.git] / LayoutTests / fast / events / touch / emulated-touch-iframe.html
1 <html>
2 <script src="../../js/resources/js-test-pre.js"></script>
3 <body>
4 <iframe style="position:absolute; top:100px; left:100px;" src="./resources/emulated-touch-iframe2.html"></iframe>
5 <p>Test touchend events are emulated in iframes correctly.</p>
6 <div id="console"></div>
7 <script type="text/javascript">
8
9 var touchstartCount = 0;
10 var EXPECTED_TOUCHSTART_COUNT = 1;
11 var shouldBail;
12
13 function testComplete()
14 {
15     if (shouldBail)
16         return;
17
18     if (touchstartCount > EXPECTED_TOUCHSTART_COUNT) {
19         debug("touchstart fired for the top frame, too, but should only fire for the iframe!");
20         shouldBail = true;
21     }
22
23     debug("touchend (test will time out if broken)");
24     window.internals.settings.setTouchEventEmulationEnabled(false);
25     window.testRunner.notifyDone();
26 }
27
28 function handleTouchstart()
29 {
30     ++touchstartCount;
31 }
32
33 function runTest() {
34     if (window.eventSender && window.internals && window.internals.settings) {
35         window.eventSender.dragMode = false;
36         window.internals.settings.setTouchEventEmulationEnabled(true);
37
38         eventSender.mouseMoveTo(110, 110);
39         eventSender.mouseDown(0);
40         eventSender.mouseMoveTo(120, 130);
41         eventSender.mouseUp(0);
42     } else
43        debug('This test requires DRT.');
44 }
45
46 if (window.testRunner)
47     window.testRunner.waitUntilDone();
48
49 </script>
50 </body>
51 </html>