Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / touch / gesture / gesture-tap-active-state-iframe.html
blob7a1212676a794c5561dd8df33a488dc4b5553abf
1 <!DOCTYPE html>
2 <html>
3 <script src="../../../../resources/js-test.js"></script>
4 <style type="text/css">
5 #frame {
6 position: absolute;
7 top: 300px;
8 left: 400px;
9 height: 3000px;
11 </style>
12 <body>
13 <iframe src='resources/gesture-tap-active-state-iframe-inner.html' id='frame'>
14 </iframe>
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>
22 <script>
23 var box;
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.");
27 function runTests()
29 if (!window.eventSender) {
30 debug('This test requires DRT.');
31 return;
34 if (!eventSender.gestureShowPress) {
35 debug('GestureShowPress is not supported by this platform');
36 return;
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)");
64 finishJSTest();
67 if (window.testRunner) {
68 window.jsTestIsAsync = true;
69 testRunner.waitUntilDone();
72 window.onload = runTests;
73 </script>
74 </body>
75 </html>