summaryrefslogtreecommitdiffstats
path: root/dom/events/test/test_bug1710509.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
commit0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch)
treea31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /dom/events/test/test_bug1710509.html
parentInitial commit. (diff)
downloadfirefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz
firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/events/test/test_bug1710509.html')
-rw-r--r--dom/events/test/test_bug1710509.html49
1 files changed, 49 insertions, 0 deletions
diff --git a/dom/events/test/test_bug1710509.html b/dom/events/test/test_bug1710509.html
new file mode 100644
index 0000000000..4454a20b9e
--- /dev/null
+++ b/dom/events/test/test_bug1710509.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Bug 1710509</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>
+ #container {
+ width: 100px;
+ height: 100px;
+ touch-action: none;
+ }
+</style>
+
+<div id="container"></div>
+
+<script>
+ /**
+ * @template {keyof HTMLElementEventMap} K
+ * @param {HTMLElemnt} target
+ * @param {K} eventName
+ * @return {HTMLElementEventMap[K]}
+ */
+ 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", false],
+ ],
+ });
+
+ await SimpleTest.promiseFocus();
+ const container = document.getElementById("container");
+ const touchMovePromise = waitForEvent(container, "touchmove");
+ await promiseNativePointerDrag(container, "pen", 50, 50, -50, -50);
+
+ const touchmove = await touchMovePromise;
+ const [touch] = touchmove.touches;
+ is(touch.radiusX, 1, ".radiusX");
+ is(touch.radiusY, 1, ".radiusX");
+ });
+</script>