Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / touch / gesture / gesture-tap-cancel-hover-state.html
blob0060db22c25c8a9788d199adf91bdfd8015ec432
1 <!DOCTYPE html>
2 <html>
3 <script src="../../../../resources/js-test.js"></script>
4 <link rel="stylesheet" href="../resources/touch-hover-active-tests.css">
5 <style type="text/css">
6 #box {
7 width: 300px;
8 height: 100px;
10 </style>
11 <body>
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>
20 <script>
21 var box = document.getElementById("box");
22 description("Tests that gesture tapcancel clears hover properly");
24 function runTests()
26 if (!window.eventSender) {
27 debug('This test requires DRT.');
28 return;
31 if (!eventSender.gestureShowPress
32 || !eventSender.gestureTapCancel) {
33 debug('Gesture events are not supported by this platform');
34 return;
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;
68 </script>
69 </body>
70 </html>