From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001
From: Daniel Baumann
Date: Sun, 7 Apr 2024 19:32:43 +0200
Subject: Adding upstream version 1:115.7.0.
Signed-off-by: Daniel Baumann
---
testing/web-platform/tests/pointerlock/META.yml | 4 +
.../tests/pointerlock/constructor.html | 53 +++++++
.../tests/pointerlock/idlharness.window.js | 18 +++
.../pointerlock/mouse_buttons_back_forward.html | 70 +++++++++
.../tests/pointerlock/movementX_Y_basic.html | 150 ++++++++++++++++++
.../pointerlock/movementX_Y_no-jumps-manual.html | 140 +++++++++++++++++
.../pointerlock/pointerlock_basic-manual.html | 149 ++++++++++++++++++
.../pointerlock/pointerlock_fullscreen-manual.html | 173 +++++++++++++++++++++
.../pointerlock/pointerlock_indefinite-manual.html | 107 +++++++++++++
.../pointerlock/pointerlock_leave_Tab-manual.html | 85 ++++++++++
.../pointerlock/pointerlock_leave_UA-manual.html | 85 ++++++++++
.../pointerlock/pointerlock_remove_target.html | 96 ++++++++++++
.../pointerlock_remove_target_on_mouseup.html | 30 ++++
.../tests/pointerlock/pointerlock_shadow.html | 93 +++++++++++
14 files changed, 1253 insertions(+)
create mode 100644 testing/web-platform/tests/pointerlock/META.yml
create mode 100644 testing/web-platform/tests/pointerlock/constructor.html
create mode 100644 testing/web-platform/tests/pointerlock/idlharness.window.js
create mode 100644 testing/web-platform/tests/pointerlock/mouse_buttons_back_forward.html
create mode 100644 testing/web-platform/tests/pointerlock/movementX_Y_basic.html
create mode 100644 testing/web-platform/tests/pointerlock/movementX_Y_no-jumps-manual.html
create mode 100644 testing/web-platform/tests/pointerlock/pointerlock_basic-manual.html
create mode 100644 testing/web-platform/tests/pointerlock/pointerlock_fullscreen-manual.html
create mode 100644 testing/web-platform/tests/pointerlock/pointerlock_indefinite-manual.html
create mode 100644 testing/web-platform/tests/pointerlock/pointerlock_leave_Tab-manual.html
create mode 100644 testing/web-platform/tests/pointerlock/pointerlock_leave_UA-manual.html
create mode 100644 testing/web-platform/tests/pointerlock/pointerlock_remove_target.html
create mode 100644 testing/web-platform/tests/pointerlock/pointerlock_remove_target_on_mouseup.html
create mode 100644 testing/web-platform/tests/pointerlock/pointerlock_shadow.html
(limited to 'testing/web-platform/tests/pointerlock')
diff --git a/testing/web-platform/tests/pointerlock/META.yml b/testing/web-platform/tests/pointerlock/META.yml
new file mode 100644
index 0000000000..bb639b4417
--- /dev/null
+++ b/testing/web-platform/tests/pointerlock/META.yml
@@ -0,0 +1,4 @@
+spec: https://w3c.github.io/pointerlock/
+suggested_reviewers:
+ - scheib
+ - siusin
diff --git a/testing/web-platform/tests/pointerlock/constructor.html b/testing/web-platform/tests/pointerlock/constructor.html
new file mode 100644
index 0000000000..8c43cf6daf
--- /dev/null
+++ b/testing/web-platform/tests/pointerlock/constructor.html
@@ -0,0 +1,53 @@
+
+
+
+
+ Pointer Lock event constructor
+
+
+
+
+
+
+ Create Pointer Lock events and check each default value.
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/pointerlock/idlharness.window.js b/testing/web-platform/tests/pointerlock/idlharness.window.js
new file mode 100644
index 0000000000..f176343a48
--- /dev/null
+++ b/testing/web-platform/tests/pointerlock/idlharness.window.js
@@ -0,0 +1,18 @@
+// META: script=/resources/WebIDLParser.js
+// META: script=/resources/idlharness.js
+
+'use strict';
+
+// https://w3c.github.io/pointerlock/
+
+idl_test(
+ ['pointerlock'],
+ ['uievents', 'html', 'dom'],
+ idl_array => {
+ idl_array.add_objects({
+ Document: ["window.document"],
+ Element: ["window.document.documentElement"],
+ MouseEvent: ["new MouseEvent('foo')"]
+ });
+ }
+);
diff --git a/testing/web-platform/tests/pointerlock/mouse_buttons_back_forward.html b/testing/web-platform/tests/pointerlock/mouse_buttons_back_forward.html
new file mode 100644
index 0000000000..6f4e764983
--- /dev/null
+++ b/testing/web-platform/tests/pointerlock/mouse_buttons_back_forward.html
@@ -0,0 +1,70 @@
+
+
+
+
+ Mouse Button Back/Forward
+
+
+
+
+
+
+
+
+
+
+ Test Description: Tests that the mouseup event is prevented.
+
+ Click the left mouse button to lock pointer
+ Click the back mouse button
+ Click the forward mouse button
+
+
+
+
diff --git a/testing/web-platform/tests/pointerlock/movementX_Y_basic.html b/testing/web-platform/tests/pointerlock/movementX_Y_basic.html
new file mode 100644
index 0000000000..a317130190
--- /dev/null
+++ b/testing/web-platform/tests/pointerlock/movementX_Y_basic.html
@@ -0,0 +1,150 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ Description
+ This test if movementX/Y can provide the change in position of the pointer, as if movementX/Y = eNow.screenX/Y-ePrevious.screenX/Y
+
+
+ Manual Test Steps:
+
+
+ Click to start Test1.
+ Move the mouse within the window, slow and fast, like a scribble.
+ Click again to end test.
+
+
+
+
+ Waiting... Click to start loging.
+
+
+ X Y
+ screen_init: X Y
+ screen_last: X Y
+ screen_delta: X Y
+ movement_sum: X Y
+ movement: X Y
+
+
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/pointerlock/movementX_Y_no-jumps-manual.html b/testing/web-platform/tests/pointerlock/movementX_Y_no-jumps-manual.html
new file mode 100644
index 0000000000..7667ece753
--- /dev/null
+++ b/testing/web-platform/tests/pointerlock/movementX_Y_no-jumps-manual.html
@@ -0,0 +1,140 @@
+
+
+
+
+
+
+
+
+
+
+ Description
+ This test that movementX/Y do not jump by a large value when exiting and re-entering the window.
+
+
+ Manual Test Steps:
+
+
+ Make sure the window is not maximized.
+ Click to start Test.
+ Move the mouse slowly out of the window.
+ Move as fast as needed to a different location outside the window at least 100 pixels away
+ Slowly re-enter the window.
+ Click again to end tests.
+
+
+
+
+ Waiting... Click to start loging.
+
+
+ X Y
+ client_init: X Y
+ client_last: X Y
+ client_delta: X Y
+ movement_sum: X Y
+ movement: X Y
+
+
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/pointerlock/pointerlock_basic-manual.html b/testing/web-platform/tests/pointerlock/pointerlock_basic-manual.html
new file mode 100644
index 0000000000..0efe9db29c
--- /dev/null
+++ b/testing/web-platform/tests/pointerlock/pointerlock_basic-manual.html
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
+
+
+ Description
+ This test validates that the pointer properly be locked in a DOM element, and exit afterwards.
+
+
+ Manual Test Steps:
+
+
+ Click the "Lock Target" to test if requestPointerLock() and exitPointerLock() causing a pointerlockchange event.
+ Confirm the lock with a user action (in Firefox).
+ Exit the pointer lock with a user action (usually 'esc'), to test if the cursor is at the same location.
+ Click the "ReEnterLock" to test that no engagement gesture is required to reenter pointer lock if pointer lock is exited via exitPointerLock.
+ Exit the pointer lock with a user action (usually 'esc').
+ Click the "RepeatLock" to validate that each requestPointerLock() will fire a pointerlockchange event.
+ Exit the pointer lock with a user action (usually 'esc').
+
+
+
+
+ Lock Target
+ ReEnter Lock
+ Repeat Lock
+ Waiting... Please click the "Lock Target" button.
+ Target
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/pointerlock/pointerlock_fullscreen-manual.html b/testing/web-platform/tests/pointerlock/pointerlock_fullscreen-manual.html
new file mode 100644
index 0000000000..d04bc2a3ef
--- /dev/null
+++ b/testing/web-platform/tests/pointerlock/pointerlock_fullscreen-manual.html
@@ -0,0 +1,173 @@
+
+
+
+
+
+
+
+
+
+
+ Description
+ This test validates that pointer lock won't be exited when fullscreen is entered or exited, unless fullscreen is exited with the same user gesture as pointer lock.
+
+
+ Manual Test Steps:
+
+
+ Click the "scriptExitFullscreen" button.
+ If the exitFullscreen doesn't work, use the menu (or any other interaction except for the "esc" key) to exit fullscreen.
+ First test case done.
+ Click the "gestureExitFullscreen" button.
+ Use the "esc" key to exit fullscreen.
+ Second test case done.
+
+
+
+
+ scriptExitFullscreen
+ gestureExitFullscreen
+
+
+
Waiting... Please click the "scriptExitFullscreen" button.
+
Target
+
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/pointerlock/pointerlock_indefinite-manual.html b/testing/web-platform/tests/pointerlock/pointerlock_indefinite-manual.html
new file mode 100644
index 0000000000..96d5f94e65
--- /dev/null
+++ b/testing/web-platform/tests/pointerlock/pointerlock_indefinite-manual.html
@@ -0,0 +1,107 @@
+
+
+
+
+
+
+
+
+
+
+ Description
+ This test validates that movementX/Y provided indefinitely even when the mouse cursor would have otherwise hit the edge of a screen.
+
+
+ Manual Test Steps:
+
+
+ Click the "lockTarget" button to request a pointer lock.
+ Move the pointer constantly in a diagonal direction (e.g. up and right).
+ Test is done.
+
+
+
+
+ lockTarget
+
+
+
Click the "lockTarget" button.
+
screenSize: NaN
+
movementX_sum: NaN
+
movementY_sum: NaN
+
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/pointerlock/pointerlock_leave_Tab-manual.html b/testing/web-platform/tests/pointerlock/pointerlock_leave_Tab-manual.html
new file mode 100644
index 0000000000..7618a9ae68
--- /dev/null
+++ b/testing/web-platform/tests/pointerlock/pointerlock_leave_Tab-manual.html
@@ -0,0 +1,85 @@
+
+
+
+
+
+
+
+
+
+
+ Description
+ This test validates that pointer lock will be lost the user agent / window loses focus.
+
+
+ Manual Test Steps:
+
+
+ Click the "lockTarget" button to request a pointer lock.
+ Focus to another tab with keyboard (Ctrl-TAB).
+ Test is done.
+
+
+
+
+ lockTarget
+
+
+
Click the "lockTarget" button.
+
Target
+
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/pointerlock/pointerlock_leave_UA-manual.html b/testing/web-platform/tests/pointerlock/pointerlock_leave_UA-manual.html
new file mode 100644
index 0000000000..d883f326b4
--- /dev/null
+++ b/testing/web-platform/tests/pointerlock/pointerlock_leave_UA-manual.html
@@ -0,0 +1,85 @@
+
+
+
+
+
+
+
+
+
+
+ Description
+ This test validates that pointer lock will be lost the user agent / window loses focus.
+
+
+ Manual Test Steps:
+
+
+ Click the "lockTarget" button to request a pointer lock.
+ Focus to another window with keyboard (ALT-TAB).
+ Test is done.
+
+
+
+
+ lockTarget
+
+
+
Click the "lockTarget" button.
+
Target
+
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/pointerlock/pointerlock_remove_target.html b/testing/web-platform/tests/pointerlock/pointerlock_remove_target.html
new file mode 100644
index 0000000000..f0bd89497e
--- /dev/null
+++ b/testing/web-platform/tests/pointerlock/pointerlock_remove_target.html
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ Description
+ This test validates that pointer lock will be lost when the target is disconnected.
+
+
+ Manual Test Steps:
+
+
+ Click the "lockTarget" button to request a pointer lock.
+ Test is done.
+
+
+
+
+ lockTarget
+
+
+
Click the "lockTarget" button.
+
Target
+
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/pointerlock/pointerlock_remove_target_on_mouseup.html b/testing/web-platform/tests/pointerlock/pointerlock_remove_target_on_mouseup.html
new file mode 100644
index 0000000000..e5256c7d7b
--- /dev/null
+++ b/testing/web-platform/tests/pointerlock/pointerlock_remove_target_on_mouseup.html
@@ -0,0 +1,30 @@
+
+
+Remove PointerLock target on mouseup
+
+
+
+
+
+Click anywhere to run the test. If a "PASS" result appears the test passes, otherwise it fails
+
+
diff --git a/testing/web-platform/tests/pointerlock/pointerlock_shadow.html b/testing/web-platform/tests/pointerlock/pointerlock_shadow.html
new file mode 100644
index 0000000000..21f3a928cd
--- /dev/null
+++ b/testing/web-platform/tests/pointerlock/pointerlock_shadow.html
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Description
+
Click the button below to trigger pointer lock on an element in a shadow root.
+
Click Me!
+
+
+
+
--
cgit v1.2.3