Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: LayoutTests/fast/events/touch/emulated-touch-iframe.html

Issue 145003002: [DevTools] Switch from blink-based to content-based touch emulation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: another rebase Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2 <script src="../../../resources/js-test.js"></script>
3 <body>
4 <iframe style="position:absolute; top:100px; left:100px;" src="./resources/emula ted-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 touchmoveCount = 0;
11 var EXPECTED_TOUCHSTART_COUNT = 1;
12 var EXPECTED_TOUCHMOVE_COUNT = 1;
13 var shouldBail;
14
15 function testComplete()
16 {
17 if (shouldBail)
18 return;
19
20 if (touchstartCount > EXPECTED_TOUCHSTART_COUNT) {
21 debug("touchstart fired for the top frame, too, but should only fire for the iframe!");
22 shouldBail = true;
23 }
24
25 if (!touchmoveCount)
26 debug("touchmove not fired for the iframe!");
27 else if (touchmoveCount > EXPECTED_TOUCHMOVE_COUNT)
28 debug("touchmove fired too many times!");
29
30 debug("touchend (test will time out if broken)");
31 window.internals.settings.setTouchEventEmulationEnabled(false);
32 window.testRunner.notifyDone();
33 }
34
35 function handleTouchmove()
36 {
37 ++touchmoveCount;
38 }
39
40 function handleTouchstart()
41 {
42 ++touchstartCount;
43 }
44
45 function runTest() {
46 if (window.eventSender && window.internals && window.internals.settings) {
47 window.eventSender.dragMode = false;
48 window.internals.settings.setTouchEventEmulationEnabled(true);
49
50 eventSender.mouseMoveTo(110, 110);
51 eventSender.mouseDown(0);
52 eventSender.mouseMoveTo(120, 130);
53 eventSender.mouseUp(0);
54 } else
55 debug('This test requires DRT.');
56 }
57
58 if (window.testRunner)
59 window.testRunner.waitUntilDone();
60
61 </script>
62 </body>
63 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698