Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Unified Diff: LayoutTests/fast/events/touch/gesture/gesture-tap-active-state.html

Issue 112023010: Make EventHandler::ActiveIntervalTimer mockable. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/events/touch/gesture/gesture-tap-active-state.html
diff --git a/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state.html b/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state.html
index 63c2dbe99d726a9075f6fd5788cf37dcc3a4efd2..d91c1cf115ddb2925da1c3c39ba096b9c8dea294 100644
--- a/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state.html
+++ b/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state.html
@@ -52,11 +52,13 @@ function runTests()
return;
}
- if (window.testRunner) {
- window.jsTestIsAsync = true;
- testRunner.waitUntilDone();
+ if (!internals.fireActiveIntervalTimer) {
+ debug('Mocked timers are not supported by this platform');
+ return;
}
+ internals.suspendActiveIntervalTimer(document);
+
debug("Verify active isn't initially set");
shouldBeFalse("isBoxActive()");
@@ -64,17 +66,8 @@ function runTests()
eventSender.gestureShowPress(50, 50);
shouldBeTrue("isBoxActive()");
eventSender.gestureTap(50, 50);
- // FIXME: Enable after implementing mocked timers (http://crbug.com/319529)
- // shouldBeTrue("isBoxActive()");
- waitUntilActiveCleared();
-}
-
-function waitUntilActiveCleared()
-{
- if (isBoxActive()) {
- return setTimeout(waitUntilActiveCleared, 10);
- }
-
+ shouldBeTrue("isBoxActive()");
+ internals.fireActiveIntervalTimer(document);
shouldBeFalse("isBoxActive()");
debug("Verify tapdown,tapcancel on the element sets and clears active");
@@ -87,16 +80,7 @@ function waitUntilActiveCleared()
eventSender.gestureShowPress(50, 50);
shouldBeTrue("isBoxActive()");
eventSender.gestureTap(400, 250);
- // FIXME: Remove after mocked timers added (http://crbug.com/319529)
- waitUntilAnotherActiveCleared();
-}
-
-function waitUntilAnotherActiveCleared()
-{
- if (isBoxActive()) {
- return setTimeout(waitUntilAnotherActiveCleared, 10);
- }
-
+ internals.fireActiveIntervalTimer(document);
shouldBeFalse("isBoxActive()");
debug("Verify tapCancel elsewhere still clears active");
@@ -121,8 +105,6 @@ function waitUntilAnotherActiveCleared()
eventSender.releaseTouchPoint(0);
eventSender.touchEnd();
shouldBeTrue("isBoxActive()");
-
- finishJSTest();
}
runTests();

Powered by Google App Engine
This is Rietveld 408576698