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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt_automation/pointerevents/pointerevent_common_input.js

Issue 2678523002: Update a few pointerevent test and the automations (Closed)
Patch Set: Add exception for Mac due to the lack of touch support Created 3 years, 10 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/external/wpt_automation/pointerevents/pointerevent_common_input.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt_automation/pointerevents/pointerevent_common_input.js b/third_party/WebKit/LayoutTests/external/wpt_automation/pointerevents/pointerevent_common_input.js
index 5e3b1de45c865bef112ca94d0afa2b9dad1d3d39..16e8661887b4a9594c703cc4299ea3d6465d89c4 100644
--- a/third_party/WebKit/LayoutTests/external/wpt_automation/pointerevents/pointerevent_common_input.js
+++ b/third_party/WebKit/LayoutTests/external/wpt_automation/pointerevents/pointerevent_common_input.js
@@ -218,7 +218,7 @@ function touchTapInTarget(targetSelector, targetFrame) {
});
}
-function touchScrollInTarget(targetSelector, direction) {
+function pointerDragInTarget(pointerType, targetSelector, direction) {
return new Promise(function(resolve, reject) {
if (window.chrome && chrome.gpuBenchmarking) {
scrollPageIfNeeded(targetSelector, document);
@@ -229,18 +229,18 @@ function touchScrollInTarget(targetSelector, direction) {
var newXPosition = xPosition;
var newYPosition = yPosition;
if (direction == "down")
- newYPosition -= scrollOffset;
- else if (direction == "up")
newYPosition += scrollOffset;
+ else if (direction == "up")
+ newYPosition -= scrollOffset;
else if (direction == "right")
- newXPosition -= scrollOffset;
- else if (direction == "left")
newXPosition += scrollOffset;
+ else if (direction == "left")
+ newXPosition -= scrollOffset;
else
- throw("Scroll direction '" + direction + "' is not expected, we expecte 'down', 'up', 'left' or 'right'");
+ throw("drag direction '" + direction + "' is not expected, direction should be 'down', 'up', 'left' or 'right'");
chrome.gpuBenchmarking.pointerActionSequence( [
- {"source": "touch",
+ {"source": pointerType,
"actions": [
{ "name": "pointerDown", "x": xPosition, "y": yPosition },
{ "name": "pointerMove", "x": newXPosition, "y": newYPosition },
@@ -253,6 +253,18 @@ function touchScrollInTarget(targetSelector, direction) {
});
}
+function touchScrollInTarget(targetSelector, direction) {
+ if (direction == "down")
+ direction = "up";
+ else if (direction == "up")
+ direction = "down";
+ else if (direction == "right")
+ direction = "left";
+ else if (direction == "left")
+ direction = "right";
+ return pointerDragInTarget('touch', targetSelector, direction);
+}
+
function pinchZoomInTarget(targetSelector, scale) {
return new Promise(function(resolve, reject) {
if (window.chrome && chrome.gpuBenchmarking) {

Powered by Google App Engine
This is Rietveld 408576698