Commit 19c42992 authored by Lan Wei's avatar Lan Wei Committed by Commit Bot

Add a WPT test to verify the mouse click count in infrastructure/

We should have a WPT test to verify the mouse click count, such as
double click and triple click. For the click count is greater than 3, we
should increase it when the OS is Windows and Mac, reset to 1 otherwise.
Also reset the mouse click count, if the mouse moves to a different
locations.

Bug: 1119679
Change-Id: I755c1f49a470598391440802e2ad62817a958777
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2515882Reviewed-by: default avatarMustaq Ahmed <mustaq@chromium.org>
Commit-Queue: Lan Wei <lanwei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#830279}
parent 79ce55d7
<!DOCTYPE html>
<meta charset="utf-8">
<title>TestDriver actions: test the mouse click counts at different cases</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#test {
position: fixed;
touch-action: none;
top: 5px;
left: 5px;
width: 100px;
height: 100px;
background-color: blue;
}
</style>
<div id="test">
</div>
<script>
let clickCountList = [];
async_test(t => {
let test = document.getElementById("test");
test.addEventListener("click", e => {
clickCountList.push(e.detail);
});
let div = document.getElementById("test");
var actions = new test_driver.Actions();
actions.pointerMove(0, 0, {origin: test})
.pointerDown()
.pointerUp()
.pointerDown()
.pointerUp()
.pointerMove(15, 15, {origin: test})
.pointerDown()
.pointerUp()
.pointerDown()
.pointerUp()
.pointerDown()
.pointerUp()
.send()
.then(t.step_func_done(() => {
let expectedClickCountList = [1, 2, 1, 2, 3];
assert_array_equals(clickCountList, expectedClickCountList);
})).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