diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/infrastructure/testdriver/actions/mouseClickCount.html | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/infrastructure/testdriver/actions/mouseClickCount.html')
-rw-r--r-- | testing/web-platform/tests/infrastructure/testdriver/actions/mouseClickCount.html | 54 |
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> |