OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <script src="../../../../resources/js-test.js"></script> | 3 <script src="../../../../resources/js-test.js"></script> |
4 | 4 |
5 <style type="text/css"> | 5 <style type="text/css"> |
6 ::-webkit-scrollbar { | 6 ::-webkit-scrollbar { |
7 width: 0px; | 7 width: 0px; |
8 height: 0px; | 8 height: 0px; |
9 } | 9 } |
10 | 10 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 if (!window.eventSender) { | 53 if (!window.eventSender) { |
54 debug('This test requires DRT.'); | 54 debug('This test requires DRT.'); |
55 return; | 55 return; |
56 } | 56 } |
57 | 57 |
58 if (!eventSender.gestureShowPress || !eventSender.gestureTap || !eventSender
.mouseMoveTo) { | 58 if (!eventSender.gestureShowPress || !eventSender.gestureTap || !eventSender
.mouseMoveTo) { |
59 debug('GestureShowPress, GestureTap, or MouseMoveTo is not supported by
this platform'); | 59 debug('GestureShowPress, GestureTap, or MouseMoveTo is not supported by
this platform'); |
60 return; | 60 return; |
61 } | 61 } |
62 | 62 |
| 63 if (!internals.fireActiveIntervalTimer) { |
| 64 debug('Mocked timers are not supported by this platform'); |
| 65 return; |
| 66 } |
| 67 |
| 68 internals.setActiveIntervalTimerInManualMode(document, true); |
| 69 |
63 debug("The Don't Click Me div should not be visible."); | 70 debug("The Don't Click Me div should not be visible."); |
64 shouldBe("dontClickMe.offsetTop", "0"); | 71 shouldBe("dontClickMe.offsetTop", "0"); |
65 | 72 |
66 debug("The Don't Click Me div should be visible after a GestureShowPress on
the Hover Over Me div."); | 73 debug("The Don't Click Me div should be visible after a GestureShowPress on
the Hover Over Me div."); |
67 shouldBe(document.elementFromPoint(50, 50).id, "hoverme"); | 74 shouldBe(document.elementFromPoint(50, 50).id, "hoverme"); |
68 eventSender.gestureShowPress(50, 50); | 75 eventSender.gestureShowPress(50, 50); |
69 shouldBe("dontClickMe.offsetTop", "100"); | 76 shouldBe("dontClickMe.offsetTop", "100"); |
70 | 77 |
71 debug("The Don't Click Me div should not be visible after a GestureTap on th
e Click Me div."); | 78 debug("The Don't Click Me div should not be visible after a GestureTap on th
e Click Me div."); |
72 shouldBe(document.elementFromPoint(250, 250).id, "clickme"); | 79 shouldBe(document.elementFromPoint(250, 250).id, "clickme"); |
73 eventSender.gestureTap(250, 250); | 80 eventSender.gestureTap(250, 250); |
74 waitUntilActiveCleared(); | 81 internals.fireActiveIntervalTimer(document); |
75 } | |
76 | |
77 function waitUntilActiveCleared() | |
78 { | |
79 if (dontClickMe.offsetTop != 0) { | |
80 return setTimeout(waitUntilActiveCleared, 10); | |
81 } | |
82 | |
83 shouldBe("dontClickMe.offsetTop", "0"); | 82 shouldBe("dontClickMe.offsetTop", "0"); |
84 | 83 |
85 debug("The Don't Click Me div should be visible after a GestureShowPress on
the Hover Over Me div."); | 84 debug("The Don't Click Me div should be visible after a GestureShowPress on
the Hover Over Me div."); |
86 shouldBe(document.elementFromPoint(50, 50).id, "hoverme"); | 85 shouldBe(document.elementFromPoint(50, 50).id, "hoverme"); |
87 eventSender.gestureShowPress(50, 50); | 86 eventSender.gestureShowPress(50, 50); |
88 shouldBe("dontClickMe.offsetTop", "100"); | 87 shouldBe("dontClickMe.offsetTop", "100"); |
89 | 88 |
90 debug("The Don't Click Me div should not be visible after a mouse move to be
low the Click Me div."); | 89 debug("The Don't Click Me div should not be visible after a mouse move to be
low the Click Me div."); |
91 eventSender.mouseMoveTo(350, 350); | 90 eventSender.mouseMoveTo(350, 350); |
92 shouldBe("dontClickMe.offsetTop", "0"); | 91 shouldBe("dontClickMe.offsetTop", "0"); |
93 | |
94 finishJSTest(); | |
95 } | |
96 | |
97 if (window.testRunner) { | |
98 window.jsTestIsAsync = true; | |
99 testRunner.waitUntilDone(); | |
100 } | 92 } |
101 | 93 |
102 runTests(); | 94 runTests(); |
103 </script> | 95 </script> |
104 </body> | 96 </body> |
105 </html> | 97 </html> |
OLD | NEW |