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

Unified Diff: LayoutTests/fast/events/touch/resources/touch-hover-active-tests.js

Issue 163933002: Send early ShowPress on TapDown when page isn't scrollable/pinchable. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Refactor into hasEarlyShowPress() Created 6 years, 9 months 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/resources/touch-hover-active-tests.js
diff --git a/LayoutTests/fast/events/touch/resources/touch-hover-active-tests.js b/LayoutTests/fast/events/touch/resources/touch-hover-active-tests.js
index 324adc75012fc2187b12170bf9b1d0101ce95e54..7371112b69f92a5c8cec4a26a2558111e7fa035a 100644
--- a/LayoutTests/fast/events/touch/resources/touch-hover-active-tests.js
+++ b/LayoutTests/fast/events/touch/resources/touch-hover-active-tests.js
@@ -26,3 +26,23 @@ function shouldBeDefault(e) { shouldBeEqualToString(e, "default"); }
function shouldBeOnlyActive(e) { shouldBeEqualToString(e, "active"); }
function shouldBeOnlyHovered(e) { shouldBeEqualToString(e, "hovered"); }
function shouldBeHoveredAndActive(e) { shouldBeEqualToString(e, "hoveredAndActive"); }
+
+function hasEarlyShowPress(e, elementLocation, shouldBeActivated)
+{
+ debug("Verify hover, active aren't initially set.");
+ shouldBeDefault(e);
+
+ eventSender.gestureTapDown(elementLocation.x, elementLocation.y);
+ if (shouldBeActivated) {
+ debug("tapDown on element should activate.");
+ shouldBeHoveredAndActive(e);
+ } else {
+ debug("tapdown on element should not activate.");
+ shouldBeDefault(e);
+ }
+
+ debug("showPress on element should " + (shouldBeActivated ? "keep hover and active." : "activate."));
+ eventSender.gestureShowPress(elementLocation.x, elementLocation.y);
+ shouldBeHoveredAndActive(e);
+ eventSender.gestureTapCancel(elementLocation.x, elementLocation.y);
+}
« no previous file with comments | « LayoutTests/fast/events/touch/gesture/resources/gesture-tap-down-iframe.html ('k') | Source/core/page/EventHandler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698