Chromium Code Reviews| Index: LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-iframe.html |
| diff --git a/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-iframe.html b/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-iframe.html |
| index db501df4a48417b22d2793096ccb9ae71c7120bd..afe6458019f0121c42ab84098181d4ee5f0e9c8a 100644 |
| --- a/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-iframe.html |
| +++ b/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-iframe.html |
| @@ -8,7 +8,6 @@ |
| left: 400px; |
| height: 3000px; |
| } |
| - |
| </style> |
| <body> |
| <iframe src='resources/gesture-tap-active-state-iframe-inner.html' id='frame'> |
| @@ -19,15 +18,14 @@ |
| <div id="console"></div> |
| +<script src="../resources/touch-hover-active-tests.js"></script> |
| <script> |
| +var box; |
| description("Tests that tap gesture events set and clear the active state of elements, even when inside an iframe and the document is scrolled."); |
| -var isBoxActive; |
| -function runTests(ba) |
| +function runTests() |
| { |
| - isBoxActive = ba; |
| - |
| if (!window.eventSender) { |
| debug('This test requires DRT.'); |
| return; |
| @@ -38,15 +36,18 @@ function runTests(ba) |
| return; |
| } |
| + box = document.getElementById("frame").contentDocument.getElementById('box'); |
|
tdresser
2014/03/14 14:24:51
Why do you just pass the id to isBox* sometimes, b
Zeeshan Qureshi
2014/03/14 14:52:21
Yeah, makes sense. Better than modifying getElemen
|
| + |
| // Scroll so the box is at the top |
| window.scrollTo(0, 400); |
| debug("Verify active isn't initially set"); |
| - shouldBeFalse("isBoxActive()"); |
| + shouldBeTrue("isBoxDefault(box)"); |
| debug("Verify tapdown,tap sets and clears active"); |
| + eventSender.gestureTapDown(450, 50); |
| eventSender.gestureShowPress(450, 50); |
| - shouldBeTrue("isBoxActive()"); |
| + shouldBeTrue("isBoxHoverActive(box)"); |
| eventSender.gestureTap(450, 50); |
| // FIXME: Enable after implementing mocked timers (http://crbug.com/319529) |
| // shouldBeTrue("isBoxActive()"); |
| @@ -55,11 +56,11 @@ function runTests(ba) |
| function waitUntilActiveCleared() |
| { |
| - if(isBoxActive()) { |
| + if(isBoxHoverActive(box, true)) { |
| return setTimeout(waitUntilActiveCleared, 10); |
| } |
| - shouldBeFalse("isBoxActive()"); |
| + shouldBeTrue("isBoxHovered(box)"); |
| finishJSTest(); |
| } |
| @@ -68,6 +69,7 @@ if (window.testRunner) { |
| testRunner.waitUntilDone(); |
| } |
| +window.onload = runTests; |
| </script> |
| </body> |
| </html> |