Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulate user inputs in wpt/touch-events/multi-touch-interactions.html #27686

Merged
merged 1 commit into from Feb 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -19,6 +19,9 @@
<meta name="viewport" content="width=device-width">
<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="multi-touch-interactions.js"></script>
<style>
div {
Expand Down
21 changes: 20 additions & 1 deletion touch-events/multi-touch-interactions.js
Expand Up @@ -67,7 +67,7 @@ function check_starting_elements(list) {
}
}

function run() {
async function run() {
var target0 = document.getElementById("target0");
var target1 = document.getElementById("target1");

Expand Down Expand Up @@ -368,4 +368,23 @@ function run() {
done();
}
});

await new test_driver.Actions()
.addPointer("touchPointer1", "touch")
.addPointer("touchPointer2", "touch")
.addPointer("touchPointer3", "touch")
.pointerMove(0, 0, {origin: target0, sourceName: "touchPointer1"})
.pointerMove(3, 0, {origin: target0, sourceName: "touchPointer2"})
.pointerDown({sourceName: "touchPointer1"})
.pointerDown({sourceName: "touchPointer2"})
.pointerMove(0, 10, {origin: target0, sourceName: "touchPointer1"})
.pointerMove(3, 10, {origin: target0, sourceName: "touchPointer2"})
.pointerMove(0, 0, {origin: target1, sourceName: "touchPointer1"})
.pointerMove(3, 0, {origin: target1, sourceName: "touchPointer2"})
.pointerMove(6, 0, {origin: target0, sourceName: "touchPointer3"})
.pointerDown({sourceName: "touchPointer3"})
.pointerUp({sourceName: "touchPointer1"})
.pointerUp({sourceName: "touchPointer2"})
.pointerUp({sourceName: "touchPointer3"})
.send();
}