Commit 49114e1c authored by Lan Wei's avatar Lan Wei Committed by Commit Bot

Use gpuBenchmarking for wheel scroll in pointer events wpt tests

After we finish the scroll unification, the scrolls happens mainly on
the compositor thread, and the scroll code in the main thread will be
removed. eventSender sends the scroll events to main thread, so it
would not work after the scroll unification. We should replace
eventSender.continuousMouseScrollBy with gpuBenchmarking.smoothScrollBy
in pointer events web-platform tests.


Bug: 1047176
Change-Id: Ie88bb707188b701d3f5a99e588fe6cffd3e23194
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2083852Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
Commit-Queue: Lan Wei <lanwei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746930}
parent d4f2133e
......@@ -144,21 +144,22 @@ function mouseDragInTarget(targetSelector) {
function mouseWheelScroll(targetSelector, direction) {
return new Promise(function(resolve, reject) {
if (window.eventSender) {
if (window.chrome && chrome.gpuBenchmarking) {
scrollPageIfNeeded(targetSelector, document);
var target = document.querySelector(targetSelector);
var targetRect = target.getBoundingClientRect();
eventSender.mouseMoveTo(
targetRect.left + boundaryOffset, targetRect.top + boundaryOffset);
eventSender.mouseDown(0);
eventSender.mouseUp(0);
if (direction == 'down')
eventSender.continuousMouseScrollBy(-scrollOffset, 0);
else if (direction == 'right')
eventSender.continuousMouseScrollBy(0, -scrollOffset);
else
reject();
resolve();
var xPosition = targetRect.left + boundaryOffset;
var yPosition = targetRect.top + boundaryOffset;
const SPEED_INSTANT = 400000;
const PRECISE_SCROLLING_DELTAS = false;
chrome.gpuBenchmarking.smoothScrollBy(scrollOffset,
resolve,
xPosition,
yPosition,
chrome.gpuBenchmarking.TOUCHPAD_INPUT,
direction,
SPEED_INSTANT,
PRECISE_SCROLLING_DELTAS);
} else {
reject();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment