Commit 8d5b17f4 authored by Lan Wei's avatar Lan Wei Committed by Commit Bot

Use testdriver Action API to generate wheel scroll action

I have added wheel input source to testdriver action API, now I am using
it to generate wheel scroll action in the wheel scroll WPT tests.


Bug: 1040611
Change-Id: Ie359068ae0347591944d80033403205f4437ecd6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2316405Reviewed-by: default avatarMustaq Ahmed <mustaq@chromium.org>
Commit-Queue: Lan Wei <lanwei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812532}
parent 4e805fd3
......@@ -2184,6 +2184,8 @@ crbug.com/893480 external/wpt/infrastructure/testdriver/actions/elementTiming.ht
crbug.com/893480 external/wpt/infrastructure/testdriver/actions/multiDevice.html [ Failure Timeout ]
crbug.com/893480 external/wpt/pointerevents/pointerevent_touch-action-keyboard.html [ Failure Timeout ]
crbug.com/893480 external/wpt/infrastructure/testdriver/actions/actionsWithKeyPressed.html [ Failure Timeout ]
crbug.com/1040611 external/wpt/uievents/order-of-events/mouse-events/wheel-basic.html [ Failure Timeout ]
crbug.com/1040611 external/wpt/uievents/order-of-events/mouse-events/wheel-scrolling.html [ Failure Timeout ]
crbug.com/893480 external/wpt/css/css-scroll-snap/input/keyboard.html [ Failure Timeout ]
# isInputPending requires threaded compositing and layerized iframes
......
......@@ -3,7 +3,7 @@
<meta charset=utf-8>
<title>WheelEvent - basic wheel event</title>
<style>
.testarea{ margin: auto; width: 80%; height: 250px; border: 1px solid grey; position: relative; }
.testarea{ margin: auto; width: 800px; height: 250px; border: 1px solid grey; position: relative; }
#wheelbox, #scrollbox { background-color: red; border: 1px solid black; margin: 0; padding: 0; }
#wheelbox.green, #scrollbox.green { background-color: green; }
......@@ -12,6 +12,9 @@
</style>
<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>
setup({explicit_timeout: true});
</script>
......@@ -38,6 +41,7 @@
var wheelbox = document.getElementById("wheelbox");
var scrollbox = document.getElementById("scrollbox");
var test_wheel = async_test("wheel event test");
var actions_promise;
EventRecorder.configure({
mergeEventTypes: ['wheel'],
......@@ -56,7 +60,10 @@
e.stopPropagation();
this.className = "green";
endTest();
test_wheel.done();
// Make sure the test finishes after all the input actions are completed.
actions_promise.then( () => {
test_wheel.done();
});
});
function endTest() {
......@@ -73,6 +80,12 @@
}
EventRecorder.start();
// Inject wheel inputs.
actions_promise = new test_driver.Actions()
.scroll(0, 0, 0, 10, {origin: wheelbox})
.scroll(160, 50, 0, 20, {origin: scrollbox})
.send();
</script>
</body>
</html>
</html>
\ No newline at end of file
......@@ -13,6 +13,9 @@
</style>
<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>
setup({explicit_timeout: true});
</script>
......@@ -35,6 +38,7 @@
<script>
var wheelbox = document.getElementById("wheelbox");
var test_wheel_scrolling = async_test("wheel scrolling test");
var actions_promise;
EventRecorder.configure({
mergeEventTypes: ['wheel'],
......@@ -47,7 +51,10 @@
e.stopPropagation();
this.className = "green";
endTest();
test_wheel_scrolling.done();
// Make sure the test finishes after all the input actions are completed.
actions_promise.then( () => {
test_wheel_scrolling.done();
});
});
function endTest() {
......@@ -62,6 +69,11 @@
}
EventRecorder.start();
// Inject wheel inputs.
actions_promise = new test_driver.Actions()
.scroll(0, 0, 0, 10, {origin: wheelbox})
.send();
</script>
<section id="lipsum">
......
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