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. +
    +
  1. Click the left mouse button to lock pointer
  2. +
  3. Click the back mouse button
  4. +
  5. Click the forward mouse button
  6. +
+

+ + 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:

+

+

    +
  1. Click to start Test1.
  2. +
  3. Move the mouse within the window, slow and fast, like a scribble.
  4. +
  5. Click again to end test.
  6. +
+

+
+ +
Waiting... Click to start loging.
+
+ + + + + + + +
XY
screen_init:XY
screen_last:XY
screen_delta:XY
movement_sum:XY
movement:XY
+
+
+ +
+ + + + 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:

+

+

    +
  1. Make sure the window is not maximized.
  2. +
  3. Click to start Test.
  4. +
  5. Move the mouse slowly out of the window. +
  6. Move as fast as needed to a different location outside the window at least 100 pixels away
  7. +
  8. Slowly re-enter the window.
  9. +
  10. Click again to end tests.
  11. +
+

+
+ +
Waiting... Click to start loging.
+
+ + + + + + + +
XY
client_init:XY
client_last:XY
client_delta:XY
movement_sum:XY
movement:XY
+
+
+ +
+ + + + 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:

+

+

    +
  1. Click the "Lock Target" to test if requestPointerLock() and exitPointerLock() causing a pointerlockchange event.
  2. +
  3. Confirm the lock with a user action (in Firefox).
  4. +
  5. Exit the pointer lock with a user action (usually 'esc'), to test if the cursor is at the same location.
  6. +
  7. Click the "ReEnterLock" to test that no engagement gesture is required to reenter pointer lock if pointer lock is exited via exitPointerLock.
  8. +
  9. Exit the pointer lock with a user action (usually 'esc').
  10. +
  11. Click the "RepeatLock" to validate that each requestPointerLock() will fire a pointerlockchange event.
  12. +
  13. Exit the pointer lock with a user action (usually 'esc').
  14. +
+

+
+ + + + +
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:

+

+

    +
  1. Click the "scriptExitFullscreen" button.
  2. +
  3. If the exitFullscreen doesn't work, use the menu (or any other interaction except for the "esc" key) to exit fullscreen.
  4. +
  5. First test case done.
  6. +
  7. Click the "gestureExitFullscreen" button.
  8. +
  9. Use the "esc" key to exit fullscreen.
  10. +
  11. Second test case done.
  12. +
+

+
+ + + + +
+
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:

+

+

    +
  1. Click the "lockTarget" button to request a pointer lock.
  2. +
  3. Move the pointer constantly in a diagonal direction (e.g. up and right).
  4. +
  5. Test is done.
  6. +
+

+
+ + + +
+
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:

+

+

    +
  1. Click the "lockTarget" button to request a pointer lock.
  2. +
  3. Focus to another tab with keyboard (Ctrl-TAB).
  4. +
  5. Test is done.
  6. +
+

+
+ + + +
+
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:

+

+

    +
  1. Click the "lockTarget" button to request a pointer lock.
  2. +
  3. Focus to another window with keyboard (ALT-TAB).
  4. +
  5. Test is done.
  6. +
+

+
+ + + +
+
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:

+

+

    +
  1. Click the "lockTarget" button to request a pointer lock.
  2. +
  3. Test is done.
  4. +
+

+
+ + + +
+
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.

+ +
+ + + -- cgit v1.2.3