Commit c4dc3441 authored by Lan Wei's avatar Lan Wei Committed by Commit Bot

[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

TBR=nzolghadr@chromium.org

Change-Id: Idad0bcca2c03f961f6c6af211d7f843f06e14fc1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1544170Reviewed-by: default avatarLan Wei <lanwei@chromium.org>
Commit-Queue: Lan Wei <lanwei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653672}
parent 53ebbdca
...@@ -3005,6 +3005,7 @@ crbug.com/893490 [ Mac ] external/wpt/css/css-text/white-space/control-chars-09F ...@@ -3005,6 +3005,7 @@ crbug.com/893490 [ Mac ] external/wpt/css/css-text/white-space/control-chars-09F
# needs implementation of test_driver_internal.action_sequence # needs implementation of test_driver_internal.action_sequence
crbug.com/893480 external/wpt/infrastructure/testdriver/actions/elementTiming.html [ Timeout ] crbug.com/893480 external/wpt/infrastructure/testdriver/actions/elementTiming.html [ Timeout ]
crbug.com/893480 external/wpt/infrastructure/testdriver/actions/multiDevice.html [ Failure Timeout ] crbug.com/893480 external/wpt/infrastructure/testdriver/actions/multiDevice.html [ Failure Timeout ]
crbug.com/893480 external/wpt/infrastructure/testdriver/actions/actionsWithKeyPressed.html [ Failure Timeout ]
# Hit a DCHECK # Hit a DCHECK
crbug.com/918664 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/sizing/block-size-with-min-or-max-content-table-1a.html [ Failure Pass ] crbug.com/918664 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/sizing/block-size-with-min-or-max-content-table-1a.html [ Failure Pass ]
......
[actionsWithKeyPressed.html]
expected:
if product == "safari" or product == "firefox": ERROR
[TestDriver actions: actions with key pressed]
expected:
if product == "chrome": FAIL
<!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>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment