Skip to content

Commit e8d1008

Browse files
LanWei22chromium-wpt-export-bot
authored andcommitted
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/+/2515882 Reviewed-by: Mustaq Ahmed <[email protected]> Commit-Queue: Lan Wei <[email protected]> Cr-Commit-Position: refs/heads/master@{#830279}
1 parent 92d9bd4 commit e8d1008

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
<title>TestDriver actions: test the mouse click counts at different cases</title>
4+
<script src="/resources/testharness.js"></script>
5+
<script src="/resources/testharnessreport.js"></script>
6+
<script src="/resources/testdriver.js"></script>
7+
<script src="/resources/testdriver-actions.js"></script>
8+
<script src="/resources/testdriver-vendor.js"></script>
9+
10+
<style>
11+
div#test {
12+
position: fixed;
13+
touch-action: none;
14+
top: 5px;
15+
left: 5px;
16+
width: 100px;
17+
height: 100px;
18+
background-color: blue;
19+
}
20+
</style>
21+
22+
<div id="test">
23+
</div>
24+
25+
<script>
26+
let clickCountList = [];
27+
28+
async_test(t => {
29+
let test = document.getElementById("test");
30+
test.addEventListener("click", e => {
31+
clickCountList.push(e.detail);
32+
});
33+
34+
let div = document.getElementById("test");
35+
var actions = new test_driver.Actions();
36+
actions.pointerMove(0, 0, {origin: test})
37+
.pointerDown()
38+
.pointerUp()
39+
.pointerDown()
40+
.pointerUp()
41+
.pointerMove(15, 15, {origin: test})
42+
.pointerDown()
43+
.pointerUp()
44+
.pointerDown()
45+
.pointerUp()
46+
.pointerDown()
47+
.pointerUp()
48+
.send()
49+
.then(t.step_func_done(() => {
50+
let expectedClickCountList = [1, 2, 1, 2, 3];
51+
assert_array_equals(clickCountList, expectedClickCountList);
52+
})).catch(e => t.step_func(() => assert_unreached("Actions sequence failed " + e)));
53+
});
54+
</script>

0 commit comments

Comments
 (0)