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

Unified Diff: third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointer-mouse.html

Issue 2141993003: PointerEvents for long-press: fix double firing & canceling MEs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed formats. Created 4 years, 5 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: third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointer-mouse.html
diff --git a/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointer-mouse.html b/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointer-mouse.html
index 09d4991d0bc340954eecb7400e11f3abaedece00..a555df9e9d13aadd00169e43c070412a082e736b 100644
--- a/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointer-mouse.html
+++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointer-mouse.html
@@ -25,10 +25,12 @@ function init() {
"pointerup",
"pointerdown",
"pointermove",
+ "pointercancel",
"click",
"touchstart",
"touchend",
"touchmove",
+ "touchcancel",
];
events.forEach(function(event) {
@@ -90,6 +92,46 @@ function testTapWithoutPairedGE() {
eventSender.gestureTap(x, y);
}
+function testLongPressWithPairedGE() {
+ var rect = document.getElementById("target").getBoundingClientRect();
+ var x = rect.left + 50;
+ var y = rect.top + 50;
+
+ var uniqueId = 1234;
+ var tapWidth = 30;
+ var tapHeight = 30;
+
+ eventSender.addTouchPoint(x, y);
+ eventSender.touchStart(uniqueId);
+ eventSender.gestureTapDown(x, y, tapWidth, tapHeight, uniqueId);
+
+ eventSender.cancelTouchPoint(0);
+ eventSender.touchCancel();
+
+ eventSender.gestureLongPress(x, y, tapWidth, tapHeight, uniqueId);
+}
+
+function testLongPressWithoutPairedGE() {
+ var rect = document.getElementById("target").getBoundingClientRect();
+ var x = rect.left + 50;
+ var y = rect.top + 50;
+
+ var uniqueId = 1234;
+ var tapWidth = 30;
+ var tapHeight = 30;
+
+ eventSender.addTouchPoint(x, y);
+ eventSender.touchStart(uniqueId);
+ eventSender.cancelTouchPoint(0);
+ eventSender.touchCancel();
+
+ eventSender.gestureTapDown(x, y, tapWidth, tapHeight, uniqueId+1);
+ eventSender.gestureLongPress(x, y);
+
+ eventSender.gestureTapDown(x, y, tapWidth, tapHeight, uniqueId+2);
+ eventSender.gestureLongPress(x, y);
+}
+
function runTests() {
[false, true, false].forEach(function(boolVal) {
debug("=== With primary pointerdown " + (boolVal ? "canceled" : "uncanceled") +" ===");
@@ -101,6 +143,12 @@ function runTests() {
debug("-- Tap without paired GEs --");
testTapWithoutPairedGE();
+ debug("-- Long-press with paired GEs --");
+ testLongPressWithPairedGE();
+
+ debug("-- Long-press without paired GEs --");
+ testLongPressWithoutPairedGE();
+
debug("");
});
}

Powered by Google App Engine
This is Rietveld 408576698