diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /dom/events/test/test_bug1692277.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/events/test/test_bug1692277.html')
-rw-r--r-- | dom/events/test/test_bug1692277.html | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/dom/events/test/test_bug1692277.html b/dom/events/test/test_bug1692277.html new file mode 100644 index 0000000000..4615c4c48b --- /dev/null +++ b/dom/events/test/test_bug1692277.html @@ -0,0 +1,43 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Bug 1692277</title> +<script src="/tests/SimpleTest/SimpleTest.js"></script> +<script src="/tests/gfx/layers/apz/test/mochitest/apz_test_utils.js"></script> +<script src="/tests/gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js"></script> +<link rel="stylesheet" href="/tests/SimpleTest/test.css" /> +<style> + @font-face { + font-family: Ahem; + src: url("/tests/dom/base/test/Ahem.ttf"); + } + + #anchor { + font: 16px/1 Ahem; + } +</style> + +<div> + <a href="#" id="anchor">A draggable link</a> +</div> + +<script> + function waitForEvent(target, eventName) { + return new Promise(resolve => { + target.addEventListener(eventName, resolve, { once: true }); + }); + } + + add_task(async function testPenDrag() { + await SpecialPowers.pushPrefEnv({ + set: [["dom.w3c_pointer_events.dispatch_by_pointer_messages", true]], + }); + + await SimpleTest.promiseFocus(); + const anchor = document.getElementById("anchor"); + await promiseNativePointerDrag(anchor, "pen", 5, 5, 50, 50); + const promise = waitForEvent(anchor, "click"); + await promiseNativePointerDrag(anchor, "pen", 5, 5, 5, 5); + await promise; + ok(true, "Got the click event"); + }); +</script> |