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 d8b682c548af638b85a36d97730b3ed7ab228346..4a4bec70c5d0d0fec131f346e9a8bb696d4c1eef 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 |
@@ -193,6 +193,43 @@ function mouseWheelScroll(targetSelector, direction) { |
}); |
} |
+// Request a pointer lock and capture. |
+function mouseRequestPointerLockAndCaptureInTarget(targetSelector, targetFrame) { |
+ var targetDocument = document; |
+ var frameLeft = 0; |
+ var frameTop = 0; |
+ var button = 'left'; |
+ if (targetFrame !== undefined) { |
+ targetDocument = targetFrame.contentDocument; |
+ var frameRect = targetFrame.getBoundingClientRect(); |
+ frameLeft = frameRect.left; |
+ frameTop = frameRect.top; |
+ } |
+ return new Promise(function(resolve, reject) { |
+ if (window.chrome && chrome.gpuBenchmarking) { |
+ scrollPageIfNeeded(targetSelector, targetDocument); |
+ var target = targetDocument.querySelector(targetSelector); |
+ var targetRect = target.getBoundingClientRect(); |
+ var xPosition = frameLeft + targetRect.left + boundaryOffset; |
+ var yPosition = frameTop + targetRect.top + boundaryOffset; |
+ |
+ chrome.gpuBenchmarking.pointerActionSequence( [ |
+ {source: 'mouse', |
+ actions: [ |
+ {name: 'pointerMove', x: xPosition, y: yPosition}, |
+ {name: 'pointerDown', x: xPosition, y: yPosition, button: 'left'}, |
+ {name: 'pointerMove', x: xPosition + 30, y: yPosition + 30}, |
+ {name: 'pointerMove', x: xPosition + 30, y: yPosition}, |
+ {name: 'pointerMove', x: xPosition + 60, y: yPosition + 30}, |
+ {name: 'pointerMove', x: xPosition + 30, y: yPosition + 20}, |
+ {name: 'pointerMove', x: xPosition + 10, y: yPosition + 50}, |
+ ]}], resolve); |
+ } else { |
+ reject(); |
+ } |
+ }); |
+} |
+ |
// Touch inputs. |
function touchTapInTarget(targetSelector, targetFrame) { |
var targetDocument = document; |