Bug 1596865 [wpt PR 20276] - Chromedriver] Fix PerformAction to support multi touch points cases, a=testonly

Automatic update from web-platform-tests
Chromedriver] Fix PerformAction to support multi touch points cases (#20276)

* Chromedriver] Fix PerformAction to support multi touch points cases

For the multiple touch points case, if we have one point move and the
other point stay still, such as
point 1: pointerdown, pause, pointerup
point 2: pointerdown, pointermove, pointerup
We should send five touch point events of "pointerdown", "pointerdown",
"pointermove", "pointerup", "pointerup" with pointer id 1, 2, 2, 1, 2.

Bug: 1020674
Change-Id: I7bdb49b7b37d4f83ef976750e106cbd27afc9e74
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1900632
Reviewed-by: John Chen <johnchen@chromium.org>
Commit-Queue: Lan Wei <lanwei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715739}

* add expectation data

* rename to ini

--

wpt-commits: df29f11cf0686caced7f382bcaff059c4dbfc070
wpt-pr: 20276
This commit is contained in:
Blink WPT Bot 2019-11-26 11:25:49 +00:00 коммит произвёл moz-wptsync-bot
Родитель b5dd7e72a5
Коммит c4dc40532e
2 изменённых файлов: 58 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,3 @@
[multiTouchPointsWithPause.html]
expected:
if product == "firefox" or product == "safari": ERROR

Просмотреть файл

@ -0,0 +1,55 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>TestDriver actions: two touch points with one moving one pause</title>
<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>
<style>
div#test1{
position: fixed;
top: 0;
left: 0;
width: 100px;
height: 100px;
background-color: blue;
}
</style>
<div id="test1">
</div>
<script>
let event_type = [];
let event_id = [];
async_test(t => {
let test1 = document.getElementById("test1");
document.getElementById("test1").addEventListener("pointerdown",
e => {event_type.push(e.type); event_id.push(e.pointerId);});
document.getElementById("test1").addEventListener("pointerup",
e => {event_type.push(e.type); event_id.push(e.pointerId);});
document.getElementById("test1").addEventListener("pointermove",
e => {event_type.push(e.type); event_id.push(e.pointerId);});
let actions = new test_driver.Actions()
.addPointer("touchPointer1", "touch")
.addPointer("touchPointer2", "touch")
.pointerMove(0, 0, {origin: test1, sourceName: "touchPointer1"})
.pointerMove(10, 0, {origin: test1, sourceName: "touchPointer2"})
.pointerDown({sourceName: "touchPointer1"})
.pointerDown({sourceName: "touchPointer2"})
.pause(0, "pointer", {sourceName: "touchPointer1"})
.pointerMove(0, 10, {origin: test1, sourceName: "touchPointer2"})
.pointerUp({sourceName: "touchPointer1"})
.pointerUp({sourceName: "touchPointer2"});
actions.send()
.then(t.step_func_done(() => {assert_array_equals(event_type, ["pointerdown", "pointerdown", "pointermove", "pointerup", "pointerup"]);
assert_array_equals(event_id, [2, 3, 3, 2, 3]);}))
.catch(e => t.step_func(() => assert_unreached("Actions sequence failed " + e)));
});
</script>