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/imported/wpt_automation/pointerevents/pointerevent_common_input.js

Issue 2627463002: Replace touch actions in pointer event tests with pointerActionSequence (Closed)
Patch Set: touch tests Created 3 years, 11 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
« no previous file with comments | « content/renderer/gpu/actions_parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/imported/wpt_automation/pointerevents/pointerevent_common_input.js
diff --git a/third_party/WebKit/LayoutTests/imported/wpt_automation/pointerevents/pointerevent_common_input.js b/third_party/WebKit/LayoutTests/imported/wpt_automation/pointerevents/pointerevent_common_input.js
index 84b0ced56c62e28e9d07dec63f597ffdf7cc55c1..c6a3c59535b8e7b83b68ef01a90a1cd46e7e97ac 100644
--- a/third_party/WebKit/LayoutTests/imported/wpt_automation/pointerevents/pointerevent_common_input.js
+++ b/third_party/WebKit/LayoutTests/imported/wpt_automation/pointerevents/pointerevent_common_input.js
@@ -160,8 +160,29 @@ function touchScrollInTarget(targetSelector, direction) {
scrollPageIfNeeded(targetSelector, document);
var target = document.querySelector(targetSelector);
var targetRect = target.getBoundingClientRect();
- chrome.gpuBenchmarking.smoothScrollBy(scrollOffset, resolve,
- targetRect.left + boundaryOffset, targetRect.top + boundaryOffset, touchSourceType, direction);
+ var xPosition = targetRect.left + boundaryOffset;
+ var yPosition = targetRect.top + boundaryOffset;
+ var newXPosition = xPosition;
+ var newYPosition = yPosition;
+ if (direction == "down")
+ newYPosition -= scrollOffset;
+ else if (direction == "up")
+ newYPosition += scrollOffset;
+ else if (direction == "right")
+ newXPosition -= scrollOffset;
+ else if (direction == "left")
+ newXPosition += scrollOffset;
+ else
+ throw("Scroll direction '" + direction + "' is not expected, we expecte 'down', 'up', 'left' or 'right'");
+
+ chrome.gpuBenchmarking.pointerActionSequence( [
+ {"source": "touch",
+ "actions": [
+ { "name": "pointerDown", "x": xPosition, "y": yPosition },
+ { "name": "pointerMove", "x": newXPosition, "y": newYPosition },
+ { "name": "pause", "duration": 0.1 },
+ { "name": "pointerUp" }
+ ]}], resolve);
} else {
reject();
}
@@ -174,9 +195,17 @@ function pinchZoomInTarget(targetSelector, scale) {
scrollPageIfNeeded(targetSelector, document);
var target = document.querySelector(targetSelector);
var targetRect = target.getBoundingClientRect();
- chrome.gpuBenchmarking.pinchBy(scale, targetRect.left + (targetRect.width/2), targetRect.top + (targetRect.height/2), function() {
- resolve();
- });
+ var xPosition = targetRect.left + (targetRect.width/2);
+ var yPosition1 = targetRect.top + (targetRect.height/2) - 10;
+ var yPosition2 = targetRect.top + (targetRect.height/2) + 10;
+ var text = '[{"source": "touch", "actions": [{ "name": "pointerDown", "x":' + xPosition +', "y":' + yPosition1 +' },';
+ for (var offset=10; offset<80; offset+=10)
+ text += '{ "name": "pointerMove", "x":' + xPosition +', "y":' + (yPosition1 - offset) +' },';
+ text += '{ "name": "pointerUp" }]}, {"source": "touch", "actions": [{ "name": "pointerDown", "x":' + xPosition +', "y":' + yPosition2 +' },';
+ for (var offset=10; offset<80; offset+=10)
+ text += '{ "name": "pointerMove", "x":' + xPosition +', "y":' + (yPosition2 + offset) +' },';
+ text += '{ "name": "pointerUp" }]}]';
+ chrome.gpuBenchmarking.pointerActionSequence(JSON.parse(text), resolve);
} else {
reject();
}
« no previous file with comments | « content/renderer/gpu/actions_parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698