Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / touch / gesture / gesture-tap-active-state-hidden-iframe.html
blobc18deda5c719b7cc85be447e58c218d34a572f12
1 <!DOCTYPE html>
2 <script src="../../../../resources/js-test.js"></script>
3 <link rel="stylesheet" href="../resources/touch-hover-active-tests.css">
4 <style type="text/css">
5 #box {
6 height: 200px;
7 width: 200px;
10 #over {
11 z-index: 9000;
12 position: absolute;
13 top: -50px;
14 left: -50px;
17 #frame {
18 width: 400px;
19 height: 400px;
20 z-index: -1;
21 position: absolute;
22 visibility: hidden;
23 left: 0;
24 top: 0;
26 </style>
27 <div id="box" class="touch-interactive">Gestures go here</div>
28 <div id="over">
29 <iframe id="frame"></iframe>
30 </div>
32 <p id="description"></p>
33 <div id="console"></div>
35 <script src="../resources/touch-hover-active-tests.js"></script>
36 <script>
37 var box = document.getElementById("box");
38 description("Tests that tap gesture events on a an element covered by a hidden iframe set and clear the active state.");
40 window.jsTestIsAsync = true;
42 function runTests()
44 if (!window.eventSender) {
45 debug("This test requires DRT.");
46 return;
49 if (!eventSender.gestureShowPress) {
50 debug("GestureShowPress is not supported by this platform");
51 return;
54 debug("Verify active isn't initially set");
55 shouldBeDefault("getHoverActiveState(box)");
57 debug("Verify showPress, tap sets and clears active");
58 eventSender.gestureTapDown(50, 50);
59 eventSender.gestureShowPress(50, 50);
60 shouldBeHoveredAndActive("getHoverActiveState(box)");
61 eventSender.gestureTap(50, 50);
62 waitUntilActiveCleared();
65 function waitUntilActiveCleared()
67 if (getHoverActiveState(box) == "hoveredAndActive") {
68 return setTimeout(waitUntilActiveCleared, 10);
71 shouldBeOnlyHovered("getHoverActiveState(box)");
73 finishJSTest();
76 window.onload = runTests;
77 </script>