3 <script src=
"../../../../resources/js-test.js"></script>
4 <link rel=
"stylesheet" href=
"../resources/touch-hover-active-tests.css">
5 <style type=
"text/css">
12 <div id=
"box" class=
"touch-interactive">Gestures go here
</div>
14 <p id=
"description"></p>
15 <p>See http://crbug.com/
316974 for details
</p>
17 <div id=
"console"></div>
19 <script src=
"../resources/touch-hover-active-tests.js"></script>
21 var box
= document
.getElementById("box");
22 description("Tests that gesture tapcancel clears hover properly");
26 if (!window
.eventSender
) {
27 debug('This test requires DRT.');
31 if (!eventSender
.gestureShowPress
32 || !eventSender
.gestureTapCancel
) {
33 debug('Gesture events are not supported by this platform');
37 debug("Verify hover, active aren't initially set");
38 shouldBeDefault("getHoverActiveState(box)");
40 debug("tapCancel on element when it is Active should keep hover");
41 eventSender
.gestureTapDown(50, 50);
42 eventSender
.gestureShowPress(50, 50);
43 shouldBeHoveredAndActive("getHoverActiveState(box)");
44 eventSender
.gestureTapCancel(50, 50);
45 shouldBeOnlyHovered("getHoverActiveState(box)");
47 debug("tapCancel outside element when it is Active should clear it");
48 eventSender
.gestureTapDown(50, 50);
49 eventSender
.gestureShowPress(50, 50);
50 shouldBeHoveredAndActive("getHoverActiveState(box)");
51 eventSender
.gestureTapCancel(400, 250);
52 shouldBeDefault("getHoverActiveState(box)");
54 debug("tapCancel on element when it is hovered but not active should keep hover");
55 eventSender
.mouseMoveTo(50, 50);
56 shouldBeOnlyHovered("getHoverActiveState(box)");
57 eventSender
.gestureTapCancel(50, 50);
58 shouldBeOnlyHovered("getHoverActiveState(box)");
60 debug("tapCancel outside element when it is hovered but not active should keep hover");
61 eventSender
.mouseMoveTo(50, 50);
62 shouldBeOnlyHovered("getHoverActiveState(box)");
63 eventSender
.gestureTapCancel(400, 250);
64 shouldBeOnlyHovered("getHoverActiveState(box)");
67 window
.onload
= runTests
;