| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <script src="../../../../resources/js-test.js"></script> | 3 <script src="../../../../resources/js-test.js"></script> |
| 4 <style type="text/css"> | 4 <style type="text/css"> |
| 5 #frame { | 5 #frame { |
| 6 position: absolute; | 6 position: absolute; |
| 7 top: 300px; | 7 top: 300px; |
| 8 left: 400px; | 8 left: 400px; |
| 9 height: 3000px; | 9 height: 3000px; |
| 10 } | 10 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 if (!window.eventSender) { | 31 if (!window.eventSender) { |
| 32 debug('This test requires DRT.'); | 32 debug('This test requires DRT.'); |
| 33 return; | 33 return; |
| 34 } | 34 } |
| 35 | 35 |
| 36 if (!eventSender.gestureShowPress) { | 36 if (!eventSender.gestureShowPress) { |
| 37 debug('GestureShowPress is not supported by this platform'); | 37 debug('GestureShowPress is not supported by this platform'); |
| 38 return; | 38 return; |
| 39 } | 39 } |
| 40 | 40 |
| 41 if (!internals.fireActiveIntervalTimer) { |
| 42 debug('Mocked timers are not supported by this platform'); |
| 43 return; |
| 44 } |
| 45 |
| 46 var iframeDoc = document.getElementById('frame').contentDocument; |
| 47 internals.setActiveIntervalTimerInManualMode(iframeDoc, true); |
| 48 |
| 41 // Scroll so the box is at the top | 49 // Scroll so the box is at the top |
| 42 window.scrollTo(0, 400); | 50 window.scrollTo(0, 400); |
| 43 | 51 |
| 44 debug("Verify active isn't initially set"); | 52 debug("Verify active isn't initially set"); |
| 45 shouldBeFalse("isBoxActive()"); | 53 shouldBeFalse("isBoxActive()"); |
| 46 | 54 |
| 47 debug("Verify tapdown,tap sets and clears active"); | 55 debug("Verify tapdown,tap sets and clears active"); |
| 48 eventSender.gestureShowPress(450, 50); | 56 eventSender.gestureShowPress(450, 50); |
| 49 shouldBeTrue("isBoxActive()"); | 57 shouldBeTrue("isBoxActive()"); |
| 50 eventSender.gestureTap(450, 50); | 58 eventSender.gestureTap(450, 50); |
| 51 // FIXME: Enable after implementing mocked timers (http://crbug.com/319529) | 59 shouldBeTrue("isBoxActive()"); |
| 52 // shouldBeTrue("isBoxActive()"); | 60 internals.fireActiveIntervalTimer(iframeDoc); |
| 53 waitUntilActiveCleared(); | |
| 54 } | |
| 55 | |
| 56 function waitUntilActiveCleared() | |
| 57 { | |
| 58 if(isBoxActive()) { | |
| 59 return setTimeout(waitUntilActiveCleared, 10); | |
| 60 } | |
| 61 | |
| 62 shouldBeFalse("isBoxActive()"); | 61 shouldBeFalse("isBoxActive()"); |
| 63 finishJSTest(); | 62 finishJSTest(); |
| 64 } | 63 } |
| 65 | 64 |
| 66 if (window.testRunner) { | 65 if (window.testRunner) { |
| 67 window.jsTestIsAsync = true; | 66 window.jsTestIsAsync = true; |
| 68 testRunner.waitUntilDone(); | 67 testRunner.waitUntilDone(); |
| 69 } | 68 } |
| 70 | 69 |
| 71 </script> | 70 </script> |
| 72 </body> | 71 </body> |
| 73 </html> | 72 </html> |
| OLD | NEW |