summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/infrastructure/testdriver/actions/mouseClickCount.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/infrastructure/testdriver/actions/mouseClickCount.html')
-rw-r--r--testing/web-platform/tests/infrastructure/testdriver/actions/mouseClickCount.html54
1 files changed, 54 insertions, 0 deletions
diff --git a/testing/web-platform/tests/infrastructure/testdriver/actions/mouseClickCount.html b/testing/web-platform/tests/infrastructure/testdriver/actions/mouseClickCount.html
new file mode 100644
index 0000000000..4f02088c5a
--- /dev/null
+++ b/testing/web-platform/tests/infrastructure/testdriver/actions/mouseClickCount.html
@@ -0,0 +1,54 @@
+<!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>