forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1602606 [wpt PR 20689] - PerformAction API supports two pointer u…
…p actions in different ticks, a=testonly Automatic update from web-platform-tests PerformAction API supports two pointer up actions in different ticks In ChromeDriver PerformAction API, we used to release all the touch points all once, because Devtool Input.dispatchTouchEvent API's touchEnd event will release all the touch points. https://chromedevtools.github.io/devtools-protocol/tot/ Input#method-dispatchTouchEvent In order to just release one touch point, we have to send touchMove event excluding the touch point we want to release from touch points list, so Devtool Input.dispatchTouchEvent will send a pointerup event for this touch point. Bug: 1020674 Change-Id: Iba44ef480284b44f914378374bc14d63cf66a5c0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1958163 Reviewed-by: John Chen <johnchen@chromium.org> Commit-Queue: Lan Wei <lanwei@chromium.org> Cr-Commit-Position: refs/heads/master@{#723137} -- First pass at adding expectations -- wpt-commits: 9e9a0defdf44857881fbdf35761bd1f1d5e7f50a, f0e2d156746a039e26db6805bd74f261d2730633 wpt-pr: 20689
- Loading branch information
1 parent
85b4a78
commit 6af75a1
Showing
4 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
...ure/metadata/infrastructure/testdriver/actions/multiTouchPointsReleaseFirstPoint.html.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[multiTouchPointsReleaseFirstPoint.html] | ||
expected: | ||
if product == "firefox" or product == "safari": ERROR | ||
[TestDriver actions: two touch points with one moving one pause] | ||
expected: | ||
if product == "chrome": FAIL |
6 changes: 6 additions & 0 deletions
6
...re/metadata/infrastructure/testdriver/actions/multiTouchPointsReleaseSecondPoint.html.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[multiTouchPointsReleaseSecondPoint.html] | ||
expected: | ||
if product == "firefox" or product == "safari": ERROR | ||
[TestDriver actions: two touch points with one moving one pause] | ||
expected: | ||
if product == "chrome": FAIL |
56 changes: 56 additions & 0 deletions
56
...b-platform/tests/infrastructure/testdriver/actions/multiTouchPointsReleaseFirstPoint.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<!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"}) | ||
.pointerUp({sourceName: "touchPointer1"}) | ||
.pointerMove(10, 10, {origin: test1, sourceName: "touchPointer2"}) | ||
.pointerUp({sourceName: "touchPointer2"}); | ||
|
||
actions.send() | ||
.then(t.step_func_done(() => { | ||
assert_array_equals(event_type, ["pointerdown", "pointerdown", "pointerup", "pointermove", "pointerup"]); | ||
assert_array_equals(event_id, [2, 3, 2, 3, 3]); | ||
})) | ||
.catch(e => t.step_func(() => assert_unreached("Actions sequence failed " + e))); | ||
}); | ||
</script> |
56 changes: 56 additions & 0 deletions
56
...-platform/tests/infrastructure/testdriver/actions/multiTouchPointsReleaseSecondPoint.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<!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"}) | ||
.pointerMove(10, 10, {origin: test1, sourceName: "touchPointer1"}) | ||
.pointerUp({sourceName: "touchPointer2"}) | ||
.pointerUp({sourceName: "touchPointer1"}); | ||
|
||
actions.send() | ||
.then(t.step_func_done(() => { | ||
assert_array_equals(event_type, ["pointerdown", "pointerdown", "pointermove", "pointerup", "pointerup"]); | ||
assert_array_equals(event_id, [2, 3, 2, 3, 2]); | ||
})) | ||
.catch(e => t.step_func(() => assert_unreached("Actions sequence failed " + e))); | ||
}); | ||
</script> |