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

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

Issue 2840023002: Fix button event on mouse events. (Closed)
Patch Set: Fix button event on mouse events. Created 3 years, 8 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 113036f4e7f20d26a3d62df953cb4b67a273c37c..ad3e89746b60aca9ff6953291dcaa002fe49d007 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
@@ -130,9 +130,12 @@ function mouseClickInTarget(targetSelector, targetFrame) {
});
}
-function mouseDragInTargets(targetSelectorList) {
+function mouseDragInTargets(targetSelectorList, button) {
return new Promise(function(resolve, reject) {
if (window.chrome && chrome.gpuBenchmarking) {
+ if (button === undefined) {
+ button = 'left';
+ }
scrollPageIfNeeded(targetSelectorList[0], document);
var target = document.querySelector(targetSelectorList[0]);
var targetRect = target.getBoundingClientRect();
@@ -142,7 +145,7 @@ function mouseDragInTargets(targetSelectorList) {
var pointerAction = pointerActions[0];
pointerAction.actions = [];
pointerAction.actions.push(
- {name: 'pointerDown', x: xPosition, y: yPosition});
+ {name: 'pointerDown', x: xPosition, y: yPosition, button: button});
for (var i = 1; i < targetSelectorList.length; i++) {
scrollPageIfNeeded(targetSelectorList[i], document);
target = document.querySelector(targetSelectorList[i]);
@@ -150,9 +153,9 @@ function mouseDragInTargets(targetSelectorList) {
xPosition = targetRect.left + boundaryOffset;
yPosition = targetRect.top + boundaryOffset;
pointerAction.actions.push(
- {name: 'pointerMove', x: xPosition, y: yPosition});
+ {name: 'pointerMove', x: xPosition, y: yPosition, button: button});
}
- pointerAction.actions.push({name: 'pointerUp'});
+ pointerAction.actions.push({name: 'pointerUp', button: button});
chrome.gpuBenchmarking.pointerActionSequence(pointerActions, resolve);
} else {
reject();

Powered by Google App Engine
This is Rietveld 408576698