-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WPT] Reland Upload a test for sending mouse events with key pressed (#…
…16475) * [WPT] Reland Upload a test for sending mouse events with key pressed When we have keyboard events and mouse events send together, we should set key modifies in mouse events. This test first presses some keys then send some mouse events. This test only works on Chrome. Bug: 606367 [email protected] Change-Id: Idad0bcca2c03f961f6c6af211d7f843f06e14fc1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1544170 Reviewed-by: Lan Wei <[email protected]> Commit-Queue: Lan Wei <[email protected]> Cr-Commit-Position: refs/heads/master@{#653672} * Update Firefox expectations to match actual results * Expect Chrome to pass
- Loading branch information
1 parent
631956b
commit 29b7c1a
Showing
2 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
infrastructure/metadata/infrastructure/testdriver/actions/actionsWithKeyPressed.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,9 @@ | ||
[actionsWithKeyPressed.html] | ||
expected: | ||
if product == "safari": ERROR | ||
|
||
|
||
[TestDriver actions: actions with key pressed] | ||
expected: | ||
if product == "firefox": FAIL | ||
|
67 changes: 67 additions & 0 deletions
67
infrastructure/testdriver/actions/actionsWithKeyPressed.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,67 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>TestDriver actions: actions with key pressed</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, div#test2 { | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100px; | ||
height: 100px; | ||
background-color: blue; | ||
} | ||
|
||
div#test2 { | ||
position: fixed; | ||
top: 100px; | ||
left: 0; | ||
width: 100px; | ||
height: 100px; | ||
background-color: green; | ||
} | ||
</style> | ||
|
||
<div id="test1"> | ||
</div> | ||
|
||
<div id="test2"> | ||
</div> | ||
|
||
<script> | ||
let keys = []; | ||
|
||
async_test(t => { | ||
let test1 = document.getElementById("test1"); | ||
let test2 = document.getElementById("test2"); | ||
document.getElementById("test1").addEventListener("click", | ||
e => {keys.push(e.getModifierState("Control"))}); | ||
document.getElementById("test2").addEventListener("click", | ||
e => {keys.push(e.getModifierState("Control"))}); | ||
|
||
let actions = new test_driver.Actions() | ||
.keyDown("\uE009") | ||
.addTick() | ||
.pointerMove(0, 0, {origin: test1}) | ||
.pointerDown() | ||
.pointerUp() | ||
.pointerMove(0, 0, {origin: test2}) | ||
.pointerDown() | ||
.pointerUp() | ||
.addTick() | ||
.keyUp("\uE009") | ||
.addTick() | ||
.pointerMove(0, 0, {origin: test1}) | ||
.pointerDown() | ||
.pointerUp(); | ||
|
||
actions.send() | ||
.then(t.step_func_done(() => assert_array_equals(keys, [true, true, false]))) | ||
.catch(e => t.step_func(() => assert_unreached("Actions sequence failed " + e))); | ||
}); | ||
</script> |