diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /testing/web-platform/tests/pointerevents/deviceproperties/pointer-event-has-device-properties-uniqueid-from-pointer-event-init.tentative.html | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz firefox-8dd16259287f58f9273002717ec4d27e97127719.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/pointerevents/deviceproperties/pointer-event-has-device-properties-uniqueid-from-pointer-event-init.tentative.html')
-rw-r--r-- | testing/web-platform/tests/pointerevents/deviceproperties/pointer-event-has-device-properties-uniqueid-from-pointer-event-init.tentative.html | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/testing/web-platform/tests/pointerevents/deviceproperties/pointer-event-has-device-properties-uniqueid-from-pointer-event-init.tentative.html b/testing/web-platform/tests/pointerevents/deviceproperties/pointer-event-has-device-properties-uniqueid-from-pointer-event-init.tentative.html new file mode 100644 index 0000000000..a37df4b421 --- /dev/null +++ b/testing/web-platform/tests/pointerevents/deviceproperties/pointer-event-has-device-properties-uniqueid-from-pointer-event-init.tentative.html @@ -0,0 +1,92 @@ +<!DOCTYPE html> +<!-- + Tentative; contingent on merge of: + https://github.com/w3c/pointerevents/pull/495 +--> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id="console"></div> + +<!-- This test verifies that pointerEvent.deviceProperties.uniqueId + can be set via PointerEventInit. --> +<script> + const UNIQUE_ID = 1001; + const INVALID_UNIQUE_ID = 0; + + function CheckDeviceId(event, uniqueId) { + assert_equals(event.deviceProperties.uniqueId, uniqueId, "uniqueId is populated"); + } + + promise_test(async () => { + if (!window.internals) + return; + var deviceProps = new DeviceProperties({ + uniqueId: 1001 + }); + var downEvent = new PointerEvent("pointerdown", + {pointerId: 1, + bubbles: true, + cancelable: true, + pointerType: "pen", + width: 100, + height: 100, + isPrimary: true, + deviceProperties: deviceProps + }); + CheckDeviceId(downEvent, UNIQUE_ID); + var moveEvent = new PointerEvent("pointermove", + {pointerId: 1, + bubbles: true, + cancelable: true, + pointerType: "pen", + width: 100, + height: 100, + isPrimary: true, + deviceProperties: deviceProps + }); + CheckDeviceId(moveEvent, UNIQUE_ID); + var upEvent = new PointerEvent("pointerup", + {pointerId: 1, + bubbles: true, + cancelable: true, + pointerType: "pen", + width: 100, + height: 100, + isPrimary: true, + deviceProperties: deviceProps + }); + CheckDeviceId(upEvent, UNIQUE_ID); + }, 'PointerEvent.deviceProperties via DevicePropertiesInit'); + + promise_test(async () => { + if (!window.internals) + return; + var emptyDeviceProps = new DeviceProperties({}); + var downEventEmptyProps = new PointerEvent("pointerdown", + {pointerId: 1, + bubbles: true, + cancelable: true, + pointerType: "pen", + width: 100, + height: 100, + isPrimary: true, + deviceProperties: emptyDeviceProps + }); + CheckDeviceId(downEventEmptyProps, INVALID_UNIQUE_ID); + }, 'PointerEvent.deviceProperties via empty DevicePropertiesInit'); + + promise_test(async () => { + if (!window.internals) + return; + var downEventEmptyProps = new PointerEvent("pointerdown", + {pointerId: 1, + bubbles: true, + cancelable: true, + pointerType: "pen", + width: 100, + height: 100, + isPrimary: true, + }); + CheckDeviceId(downEventEmptyProps, INVALID_UNIQUE_ID); + }, 'No deviceProperties in PointerEventInit'); +</script>
\ No newline at end of file |