Skip to content

Commit

Permalink
Simulate user inputs in pointerevents/pointerevent_touch-action-mouse…
Browse files Browse the repository at this point in the history
….html

Use testdriver Action API to simulate wheel scroll actions in
pointerevents/pointerevent_touch-action-mouse.html.

Bug: 1145677
Change-Id: I56d99d22a325419865fdc18dfa4cf0a3ae55df51
  • Loading branch information
LanWei22 authored and chromium-wpt-export-bot committed Jan 29, 2021
1 parent 5a0293c commit 57c6a5d
Showing 1 changed file with 14 additions and 1 deletion.
Expand Up @@ -6,6 +6,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 {
Expand Down Expand Up @@ -86,6 +89,7 @@ <h4 id="desc">Test Description: Try to scroll text down using mouse (use mouse w
var target0 = document.getElementById("target0");

var test_touchaction = async_test("touch-action attribute test");
var actions_promise;

xScr0 = target0.scrollLeft;
yScr0 = target0.scrollTop;
Expand All @@ -111,10 +115,19 @@ <h4 id="desc">Test Description: Try to scroll text down using mouse (use mouse w
}

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();
}
});

var scrollDeltaX = 200;
var scrollDeltaY = 200;
actions_promise = new test_driver.Actions()
.scroll(0, 0, scrollDeltaX, scrollDeltaY, {origin: target0})
.send();
}

function updateDescriptionNextStepMouse() {
Expand Down

0 comments on commit 57c6a5d

Please sign in to comment.