3 <script src=
"../../../../resources/js-test.js"></script>
4 <style type=
"text/css">
13 <iframe src='resources/gesture-tap-active-state-iframe-inner.html' id='frame'
>
16 <p id=
"description"></p>
17 <p>See https://bugs.webkit.org/show_bug.cgi?id=
96060 for details
</p>
19 <div id=
"console"></div>
21 <script src=
"../resources/touch-hover-active-tests.js"></script>
25 description("Tests that tap gesture events set and clear the active state of elements, even when inside an iframe and the document is scrolled.");
29 if (!window
.eventSender
) {
30 debug('This test requires DRT.');
34 if (!eventSender
.gestureShowPress
) {
35 debug('GestureShowPress is not supported by this platform');
39 box
= document
.getElementById("frame").contentDocument
.getElementById('box');
41 // Scroll so the box is at the top
42 window
.scrollTo(0, 400);
44 debug("Verify active isn't initially set");
45 shouldBeDefault("getHoverActiveState(box)");
47 debug("Verify showPress, tap sets and clears active");
48 eventSender
.gestureTapDown(450, 50);
49 eventSender
.gestureShowPress(450, 50);
50 shouldBeHoveredAndActive("getHoverActiveState(box)");
51 eventSender
.gestureTap(450, 50);
52 // FIXME: Enable after implementing mocked timers (http://crbug.com/319529)
53 // shouldBeTrue("isBoxActive()");
54 waitUntilActiveCleared();
57 function waitUntilActiveCleared()
59 if(getHoverActiveState(box
) == "hoveredAndActive") {
60 return setTimeout(waitUntilActiveCleared
, 10);
63 shouldBeOnlyHovered("getHoverActiveState(box)");
67 if (window
.testRunner
) {
68 window
.jsTestIsAsync
= true;
69 testRunner
.waitUntilDone();
72 window
.onload
= runTests
;