Commit 2ef3bab9 authored by Lan Wei's avatar Lan Wei Committed by Commit Bot

Use testdriver Action API in WPT pointerevent tests - Part 8

In order to run the web-platform-tests automatically, we will use
testdriver Action API in all the wpt to simulate inputs. Here we are
changing a pointerevent input tests which have keyboard scroll actions.

This is the seventh CL that changes part of the pointerevent input
tests.

Bug: 606367
Change-Id: Ic468d3bd61569ae4edc9cc2234a5b7056055ff5d

TBR=nzolghadr@chromium.org

Change-Id: Ic468d3bd61569ae4edc9cc2234a5b7056055ff5d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1636818Reviewed-by: default avatarLan Wei <lanwei@chromium.org>
Commit-Queue: Lan Wei <lanwei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#665021}
parent 2c2f988f
......@@ -2782,6 +2782,7 @@ crbug.com/893490 [ Mac ] external/wpt/css/css-text/white-space/control-chars-09F
crbug.com/893480 external/wpt/infrastructure/testdriver/actions/elementTiming.html [ Timeout ]
crbug.com/893480 external/wpt/infrastructure/testdriver/actions/multiDevice.html [ Failure Timeout ]
crbug.com/893480 external/wpt/dom/nodes/keyboard-scroll-removed-node.html [ Failure Timeout ]
crbug.com/893480 external/wpt/pointerevents/pointerevent_touch-action-keyboard.html [ Failure Timeout ]
# Hit a DCHECK
crbug.com/918664 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/sizing/block-size-with-min-or-max-content-table-1a.html [ Failure Pass ]
......
......@@ -7,6 +7,9 @@
<link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="pointerevent_support.js"></script>
<style>
#target0 {
......@@ -84,6 +87,7 @@
var target0 = document.getElementById("target0");
var test_touchaction = async_test("touch-action attribute test");
var actions_promise;
xScr0 = target0.scrollLeft;
yScr0 = target0.scrollTop;
......@@ -107,10 +111,25 @@
}
if(xScrollIsReceived && yScrollIsReceived) {
test_touchaction.done();
// Make sure the test finishes after all the input actions are completed.
actions_promise.then( () => {
test_touchaction.done();
});
updateDescriptionComplete();
}
});
// Inject keyboard scroll inputs.
actions_promise = new test_driver.Actions()
.pointerMove(0, 0, {origin: target0})
.pointerDown()
.pointerUp()
.addTick()
.keyDown("\uE015")
.keyUp("\uE015")
.keyDown("\uE014")
.keyUp("\uE014")
.send();
}
function updateDescriptionNextStepKeyboard() {
......
......@@ -561,23 +561,6 @@ function mouseDragAndDropInTargets(targetSelectorList) {
});
}
// Keyboard inputs.
function keyboardScroll(direction) {
return new Promise(function(resolve, reject) {
if (window.eventSender) {
if (direction == 'down')
eventSender.keyDown('ArrowDown');
else if (direction == 'right')
eventSender.keyDown('ArrowRight');
else
reject();
resolve();
} else {
reject();
}
});
}
function smoothDrag(targetSelector1, targetSelector2, pointerType) {
return new Promise(function(resolve, reject) {
if (window.chrome && chrome.gpuBenchmarking) {
......
importAutomationScript('/pointerevents/pointerevent_common_input.js');
function inject_input() {
return mouseClickInTarget('#target0').then(function() {
return keyboardScroll('down');
}).then(function() {
return keyboardScroll('right');
});
}
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