summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/pointerevents/deviceproperties/get-device-properties-uniqueid-from-pointer-event.tentative.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/pointerevents/deviceproperties/get-device-properties-uniqueid-from-pointer-event.tentative.html')
-rw-r--r--testing/web-platform/tests/pointerevents/deviceproperties/get-device-properties-uniqueid-from-pointer-event.tentative.html45
1 files changed, 45 insertions, 0 deletions
diff --git a/testing/web-platform/tests/pointerevents/deviceproperties/get-device-properties-uniqueid-from-pointer-event.tentative.html b/testing/web-platform/tests/pointerevents/deviceproperties/get-device-properties-uniqueid-from-pointer-event.tentative.html
new file mode 100644
index 0000000000..dc6b9379c1
--- /dev/null
+++ b/testing/web-platform/tests/pointerevents/deviceproperties/get-device-properties-uniqueid-from-pointer-event.tentative.html
@@ -0,0 +1,45 @@
+<!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>
+<script src="/resources/testdriver.js"></script>
+<script src="/resources/testdriver-actions.js"></script>
+<script src="/resources/testdriver-vendor.js"></script>
+
+<style>
+ div {
+ user-select: none; // Prevents text selection on drag.
+ }
+</style>
+<div id="logger" draggable="false"></div>
+<div id="console"></div>
+<!-- This test verifies that pointerEvent.deviceProperties.uniqueId is 0
+ by default for a pointer with an invalid hardware id - in this case
+ a testdriver generated event, which does not support hardware id. -->
+<script>
+ function CheckDeviceId(event) {
+ eventFired++;
+ assert_equals(event.deviceProperties.uniqueId, 0, "deviceId is 0");
+ }
+
+ window.addEventListener("pointerdown", CheckDeviceId, false);
+ window.addEventListener("pointermove", CheckDeviceId, false);
+
+ promise_test(async () => {
+ if (!window.internals)
+ return;
+ eventFired = 0;
+ let actions = new test_driver.Actions()
+ .addPointer("TestPointer", "pen")
+ .pointerDown()
+ .pointerMove(100, 100)
+ .pointerUp();
+
+ await actions.send();
+
+ assert_true(eventFired == 2);
+ }, 'PointerEvent.deviceProperties.uniqueId');
+</script> \ No newline at end of file