From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../file_allowPointerLockSandboxFlag.html | 96 ++++++++++ .../pointerlock/file_changeLockElement.html | 115 +++++++++++ .../mochitest/pointerlock/file_childIframe.html | 134 +++++++++++++ .../mochitest/pointerlock/file_doubleLock.html | 64 +++++++ .../mochitest/pointerlock/file_escapeKey.html | 77 ++++++++ .../pointerlock/file_infiniteMovement.html | 114 +++++++++++ .../mochitest/pointerlock/file_locksvgelement.html | 62 ++++++ .../mochitest/pointerlock/file_movementXY.html | 106 +++++++++++ .../pointerlock/file_nestedFullScreen.html | 76 ++++++++ .../pointerlock/file_pointerLockPref.html | 75 ++++++++ .../file_pointerlock-api-with-shadow.html | 110 +++++++++++ .../pointerlock/file_pointerlock-api.html | 104 ++++++++++ .../file_pointerlock_xorigin_iframe.html | 125 ++++++++++++ ...pointerlock_xorigin_iframe_no_user_gesture.html | 95 +++++++++ ...ile_pointerlock_xorigin_iframe_not_focused.html | 112 +++++++++++ .../pointerlock/file_pointerlockerror.html | 41 ++++ .../mochitest/pointerlock/file_removedFromDOM.html | 95 +++++++++ .../pointerlock/file_retargetMouseEvents.html | 212 +++++++++++++++++++++ .../pointerlock/file_screenClientXYConst.html | 143 ++++++++++++++ .../pointerlock/file_suppressSomeMouseEvents.html | 158 +++++++++++++++ .../pointerlock/file_targetOutOfFocus.html | 69 +++++++ .../mochitest/pointerlock/file_withoutDOM.html | 54 ++++++ .../mochitest/pointerlock/iframe_differentDOM.html | 7 + dom/tests/mochitest/pointerlock/mochitest.toml | 49 +++++ .../mochitest/pointerlock/pointerlock_utils.js | 112 +++++++++++ .../test_closewindow-with-pointerlock.html | 51 +++++ .../pointerlock/test_pointerlock-api.html | 113 +++++++++++ .../pointerlock/test_pointerlock_focus.html | 111 +++++++++++ ..._pointerlock_target_not_in_active_document.html | 77 ++++++++ .../test_pointerlock_xorigin_iframe.html | 59 ++++++ 30 files changed, 2816 insertions(+) create mode 100644 dom/tests/mochitest/pointerlock/file_allowPointerLockSandboxFlag.html create mode 100644 dom/tests/mochitest/pointerlock/file_changeLockElement.html create mode 100644 dom/tests/mochitest/pointerlock/file_childIframe.html create mode 100644 dom/tests/mochitest/pointerlock/file_doubleLock.html create mode 100644 dom/tests/mochitest/pointerlock/file_escapeKey.html create mode 100644 dom/tests/mochitest/pointerlock/file_infiniteMovement.html create mode 100644 dom/tests/mochitest/pointerlock/file_locksvgelement.html create mode 100644 dom/tests/mochitest/pointerlock/file_movementXY.html create mode 100644 dom/tests/mochitest/pointerlock/file_nestedFullScreen.html create mode 100644 dom/tests/mochitest/pointerlock/file_pointerLockPref.html create mode 100644 dom/tests/mochitest/pointerlock/file_pointerlock-api-with-shadow.html create mode 100644 dom/tests/mochitest/pointerlock/file_pointerlock-api.html create mode 100644 dom/tests/mochitest/pointerlock/file_pointerlock_xorigin_iframe.html create mode 100644 dom/tests/mochitest/pointerlock/file_pointerlock_xorigin_iframe_no_user_gesture.html create mode 100644 dom/tests/mochitest/pointerlock/file_pointerlock_xorigin_iframe_not_focused.html create mode 100644 dom/tests/mochitest/pointerlock/file_pointerlockerror.html create mode 100644 dom/tests/mochitest/pointerlock/file_removedFromDOM.html create mode 100644 dom/tests/mochitest/pointerlock/file_retargetMouseEvents.html create mode 100644 dom/tests/mochitest/pointerlock/file_screenClientXYConst.html create mode 100644 dom/tests/mochitest/pointerlock/file_suppressSomeMouseEvents.html create mode 100644 dom/tests/mochitest/pointerlock/file_targetOutOfFocus.html create mode 100644 dom/tests/mochitest/pointerlock/file_withoutDOM.html create mode 100644 dom/tests/mochitest/pointerlock/iframe_differentDOM.html create mode 100644 dom/tests/mochitest/pointerlock/mochitest.toml create mode 100644 dom/tests/mochitest/pointerlock/pointerlock_utils.js create mode 100644 dom/tests/mochitest/pointerlock/test_closewindow-with-pointerlock.html create mode 100644 dom/tests/mochitest/pointerlock/test_pointerlock-api.html create mode 100644 dom/tests/mochitest/pointerlock/test_pointerlock_focus.html create mode 100644 dom/tests/mochitest/pointerlock/test_pointerlock_target_not_in_active_document.html create mode 100644 dom/tests/mochitest/pointerlock/test_pointerlock_xorigin_iframe.html (limited to 'dom/tests/mochitest/pointerlock') diff --git a/dom/tests/mochitest/pointerlock/file_allowPointerLockSandboxFlag.html b/dom/tests/mochitest/pointerlock/file_allowPointerLockSandboxFlag.html new file mode 100644 index 0000000000..33f550f7d7 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_allowPointerLockSandboxFlag.html @@ -0,0 +1,96 @@ + + + + + Bug 784402 + + + + + + + + Mozilla Bug 784402 +

+ + + +
+      
+    
+ + diff --git a/dom/tests/mochitest/pointerlock/file_changeLockElement.html b/dom/tests/mochitest/pointerlock/file_changeLockElement.html new file mode 100644 index 0000000000..62c5b27956 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_changeLockElement.html @@ -0,0 +1,115 @@ + + + + + Bug 1284788 + + + + + + + +
+
+
+
+ +
+ + diff --git a/dom/tests/mochitest/pointerlock/file_childIframe.html b/dom/tests/mochitest/pointerlock/file_childIframe.html new file mode 100644 index 0000000000..9ee3153d2e --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_childIframe.html @@ -0,0 +1,134 @@ + + + + + Bug 633602 - file_childIframe.html + + + + + + + + + Mozilla Bug 633602 + + +
+ + + + + +
+ + +
+
+
+
+ +
+    
+  
+ + diff --git a/dom/tests/mochitest/pointerlock/file_doubleLock.html b/dom/tests/mochitest/pointerlock/file_doubleLock.html new file mode 100644 index 0000000000..93e156a0b0 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_doubleLock.html @@ -0,0 +1,64 @@ + + + + + Bug 633602 - file_doubleLockCallBack.html + + + + + + + + + Mozilla Bug 633602 +
+
+    
+  
+ + diff --git a/dom/tests/mochitest/pointerlock/file_escapeKey.html b/dom/tests/mochitest/pointerlock/file_escapeKey.html new file mode 100644 index 0000000000..987b880232 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_escapeKey.html @@ -0,0 +1,77 @@ + + + + + Bug 633602 + + + + + + + + Mozilla Bug 633602 + +
+
+    
+  
+ + diff --git a/dom/tests/mochitest/pointerlock/file_infiniteMovement.html b/dom/tests/mochitest/pointerlock/file_infiniteMovement.html new file mode 100644 index 0000000000..995d99843b --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_infiniteMovement.html @@ -0,0 +1,114 @@ + + + + + Bug 633602 - file_movementXY.html + + + + + + + + Mozilla Bug 633602 + +
+
+      
+    
+ + diff --git a/dom/tests/mochitest/pointerlock/file_locksvgelement.html b/dom/tests/mochitest/pointerlock/file_locksvgelement.html new file mode 100644 index 0000000000..edbfa45995 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_locksvgelement.html @@ -0,0 +1,62 @@ + + + + + Bug 633602 + + + + + + + + Mozilla Bug 633602 +

+ + + + + +
+      
+    
+ + diff --git a/dom/tests/mochitest/pointerlock/file_movementXY.html b/dom/tests/mochitest/pointerlock/file_movementXY.html new file mode 100644 index 0000000000..7ef47cfaa9 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_movementXY.html @@ -0,0 +1,106 @@ + + + + + Bug 633602 - file_movementXY.html + + + + + + + + Mozilla Bug 633602 + +
+
+      
+    
+ + diff --git a/dom/tests/mochitest/pointerlock/file_nestedFullScreen.html b/dom/tests/mochitest/pointerlock/file_nestedFullScreen.html new file mode 100644 index 0000000000..8d625b6704 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_nestedFullScreen.html @@ -0,0 +1,76 @@ + + + + + Bug 633602 - file_nestedFullScreen.html + + + + + + + + Mozilla Bug 633602 + + +
+
+
+ + + + diff --git a/dom/tests/mochitest/pointerlock/file_pointerLockPref.html b/dom/tests/mochitest/pointerlock/file_pointerLockPref.html new file mode 100644 index 0000000000..09c3b42052 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_pointerLockPref.html @@ -0,0 +1,75 @@ + + + + + Bug 633602 + + + + + + + + Mozilla Bug 633602 +

+
+
+      
+    
+ + diff --git a/dom/tests/mochitest/pointerlock/file_pointerlock-api-with-shadow.html b/dom/tests/mochitest/pointerlock/file_pointerlock-api-with-shadow.html new file mode 100644 index 0000000000..a9c2d525de --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_pointerlock-api-with-shadow.html @@ -0,0 +1,110 @@ + + + + + Bug 633602 + + + + + + + + Mozilla Bug 633602 + +
+
+    
+  
+ + diff --git a/dom/tests/mochitest/pointerlock/file_pointerlock-api.html b/dom/tests/mochitest/pointerlock/file_pointerlock-api.html new file mode 100644 index 0000000000..6f5fb537be --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_pointerlock-api.html @@ -0,0 +1,104 @@ + + + + + Bug 633602 + + + + + + + + Mozilla Bug 633602 + +
+
+    
+  
+ + diff --git a/dom/tests/mochitest/pointerlock/file_pointerlock_xorigin_iframe.html b/dom/tests/mochitest/pointerlock/file_pointerlock_xorigin_iframe.html new file mode 100644 index 0000000000..f8e34ef64b --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_pointerlock_xorigin_iframe.html @@ -0,0 +1,125 @@ + + + + +Bug 1662587 + + + + + + + +Mozilla Bug 1662587 +
+ + +
+
+
+ + diff --git a/dom/tests/mochitest/pointerlock/file_pointerlock_xorigin_iframe_no_user_gesture.html b/dom/tests/mochitest/pointerlock/file_pointerlock_xorigin_iframe_no_user_gesture.html new file mode 100644 index 0000000000..68977ffada --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_pointerlock_xorigin_iframe_no_user_gesture.html @@ -0,0 +1,95 @@ + + + + +Bug 1672330 + + + + + + + + + +Mozilla Bug 1672330 +
+ + +
+
+
+ + diff --git a/dom/tests/mochitest/pointerlock/file_pointerlock_xorigin_iframe_not_focused.html b/dom/tests/mochitest/pointerlock/file_pointerlock_xorigin_iframe_not_focused.html new file mode 100644 index 0000000000..a6c0058657 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_pointerlock_xorigin_iframe_not_focused.html @@ -0,0 +1,112 @@ + + + + +Bug 1662587 + + + + + + + +Mozilla Bug 1698611 +
+ + +
+
+
+ + diff --git a/dom/tests/mochitest/pointerlock/file_pointerlockerror.html b/dom/tests/mochitest/pointerlock/file_pointerlockerror.html new file mode 100644 index 0000000000..0948a19452 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_pointerlockerror.html @@ -0,0 +1,41 @@ + + + + + Bug 633602 + + + + + + + + Mozilla Bug 633602 + + +
+    
+  
+ + diff --git a/dom/tests/mochitest/pointerlock/file_removedFromDOM.html b/dom/tests/mochitest/pointerlock/file_removedFromDOM.html new file mode 100644 index 0000000000..3e2f9ca866 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_removedFromDOM.html @@ -0,0 +1,95 @@ + + + + +Bug 633602 - file_DOMtree.html + + + + + + + + Mozilla Bug 633602 + +
+
+
+
+
+ + diff --git a/dom/tests/mochitest/pointerlock/file_retargetMouseEvents.html b/dom/tests/mochitest/pointerlock/file_retargetMouseEvents.html new file mode 100644 index 0000000000..2cd329bb33 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_retargetMouseEvents.html @@ -0,0 +1,212 @@ + + + + + Bug 633602 - file_retargetMouseEvents.html + + + + + + + + Mozilla Bug 633602 + + +
+
+
+
+ +
+    
+  
+ + diff --git a/dom/tests/mochitest/pointerlock/file_screenClientXYConst.html b/dom/tests/mochitest/pointerlock/file_screenClientXYConst.html new file mode 100644 index 0000000000..31bd232a57 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_screenClientXYConst.html @@ -0,0 +1,143 @@ + + + + + Bug 633602 - constantXY.html + + + + + + + + Mozilla Bug 633602 + +
+ + + diff --git a/dom/tests/mochitest/pointerlock/file_suppressSomeMouseEvents.html b/dom/tests/mochitest/pointerlock/file_suppressSomeMouseEvents.html new file mode 100644 index 0000000000..bc1e1e64a5 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_suppressSomeMouseEvents.html @@ -0,0 +1,158 @@ + + + + + Bug 633602 - file_cursorPosEvents.html + + + + + + + + + Mozilla Bug 633602 + +
+
+
+ + + + diff --git a/dom/tests/mochitest/pointerlock/file_targetOutOfFocus.html b/dom/tests/mochitest/pointerlock/file_targetOutOfFocus.html new file mode 100644 index 0000000000..4a6b9084bb --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_targetOutOfFocus.html @@ -0,0 +1,69 @@ + + + + + Bug 633602 - file_targetOutOfFocus.html + + + + + + + + Mozilla Bug 633602 + +

+
+
+
+ +
+
+      
+    
+ + diff --git a/dom/tests/mochitest/pointerlock/file_withoutDOM.html b/dom/tests/mochitest/pointerlock/file_withoutDOM.html new file mode 100644 index 0000000000..c63a72cf9a --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_withoutDOM.html @@ -0,0 +1,54 @@ + + + + + Bug 633602 - file_DOMtree.html + + + + + + + + + Mozilla Bug 633602 + +
+      
+    
+ + diff --git a/dom/tests/mochitest/pointerlock/iframe_differentDOM.html b/dom/tests/mochitest/pointerlock/iframe_differentDOM.html new file mode 100644 index 0000000000..0e3eac19b9 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/iframe_differentDOM.html @@ -0,0 +1,7 @@ + + + + +
+ + diff --git a/dom/tests/mochitest/pointerlock/mochitest.toml b/dom/tests/mochitest/pointerlock/mochitest.toml new file mode 100644 index 0000000000..87e2879cd3 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/mochitest.toml @@ -0,0 +1,49 @@ +[DEFAULT] +support-files = [ + "pointerlock_utils.js", + "iframe_differentDOM.html", + "!/gfx/layers/apz/test/mochitest/apz_test_utils.js", +] + +["test_closewindow-with-pointerlock.html"] + +["test_pointerlock-api.html"] +tags = "fullscreen" +skip-if = [ + "os == 'android'", # Bug 1612553 + "display == 'wayland' && os_version == '22.04'", # Bug 1857057 + "!debug && !asan && !tsan && !ccov", # Bug 1833142 +] +support-files = [ + "file_pointerlock-api.html", + "file_pointerlock-api-with-shadow.html", + "file_pointerlockerror.html", + "file_escapeKey.html", + "file_withoutDOM.html", + "file_removedFromDOM.html", + "file_pointerLockPref.html", + "file_nestedFullScreen.html", + "file_doubleLock.html", + "file_childIframe.html", + "file_movementXY.html", + "file_infiniteMovement.html", + "file_retargetMouseEvents.html", + "file_targetOutOfFocus.html", + "file_screenClientXYConst.html", + "file_suppressSomeMouseEvents.html", + "file_locksvgelement.html", + "file_allowPointerLockSandboxFlag.html", + "file_changeLockElement.html", +] + +["test_pointerlock_focus.html"] + +["test_pointerlock_target_not_in_active_document.html"] + +["test_pointerlock_xorigin_iframe.html"] +support-files = [ + "file_pointerlock_xorigin_iframe.html", + "file_pointerlock_xorigin_iframe_no_user_gesture.html", + "file_pointerlock_xorigin_iframe_not_focused.html", +] +skip-if = ["display == 'wayland' && os_version == '22.04'"] # Bug 1857057 diff --git a/dom/tests/mochitest/pointerlock/pointerlock_utils.js b/dom/tests/mochitest/pointerlock/pointerlock_utils.js new file mode 100644 index 0000000000..050d161070 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/pointerlock_utils.js @@ -0,0 +1,112 @@ +const { ChromeUtils } = SpecialPowers; +const { TestUtils } = ChromeUtils.importESModule( + "resource://testing-common/TestUtils.sys.mjs" +); + +// Get test filename for page being run in popup so errors are more useful +var testName = location.pathname.split("/").pop(); + +// Wrap test functions and pass to parent window +window.ok = function (a, msg) { + opener.ok(a, testName + ": " + msg); +}; + +window.is = function (a, b, msg) { + opener.is(a, b, testName + ": " + msg); +}; + +window.isnot = function (a, b, msg) { + opener.isnot(a, b, testName + ": " + msg); +}; + +window.todo = function (a, msg) { + opener.todo(a, testName + ": " + msg); +}; + +window.todo_is = function (a, b, msg) { + opener.todo_is(a, b, testName + ": " + msg); +}; + +window.todo_isnot = function (a, b, msg) { + opener.todo_isnot(a, b, testName + ": " + msg); +}; + +window.info = function (msg) { + opener.info(testName + ": " + msg); +}; + +// Override bits of SimpleTest so test files work stand-alone +var SimpleTest = SimpleTest || {}; + +SimpleTest.waitForExplicitFinish = function () { + dump("[POINTERLOCK] Starting " + testName + "\n"); +}; + +SimpleTest.finish = function () { + dump("[POINTERLOCK] Finishing " + testName + "\n"); + opener.nextTest(); +}; + +// Keep track of how many fullscreenChange enters we've received, so that +// we can balance them with the number of exits we receive. We reset this +// to 0 when we load a test. +var fullscreenChangeEnters = 0; + +addLoadEvent(function () { + info(`Resetting fullscreen enter count.`); + fullscreenChangeEnters = 0; + if (typeof start !== "undefined") { + // Delay one event loop to stabilize the initial state of the page. + SimpleTest.executeSoon(start); + } +}); + +// Returns true if the window believes it is in fullscreen. This may be true even +// before an asynchronous fullscreen transition is complete. +function inFullscreenMode(win) { + return win.document.fullscreenElement; +} + +// Adds a listener that will be called once a fullscreen transition +// is complete. When type==='enter', callback is called when we've +// received a fullscreenchange event, and the fullscreen transition is +// complete. When type==='exit', callback is called when we've +// received a fullscreenchange event and the window is out of +// fullscreen. inDoc is the document which the listeners are added on, +// if absent, the listeners are added to the current document. +function addFullscreenChangeContinuation(type, callback, inDoc) { + var doc = inDoc || document; + var topWin = doc.defaultView.top; + function checkCondition() { + if (type == "enter") { + fullscreenChangeEnters++; + return inFullscreenMode(topWin); + } else if (type == "exit") { + fullscreenChangeEnters--; + return fullscreenChangeEnters + ? inFullscreenMode(topWin) + : !inFullscreenMode(topWin); + } else { + throw "'type' must be either 'enter', or 'exit'."; + } + } + function onFullscreenChange(event) { + doc.removeEventListener("fullscreenchange", onFullscreenChange); + ok(checkCondition(), `Should ${type} fullscreen.`); + + // Invoke the callback after the browsingContext has become active + // (or we've timed out waiting for it to become active). + let bc = SpecialPowers.wrap(topWin).browsingContext; + TestUtils.waitForCondition( + () => bc.isActive, + "browsingContext should become active" + ) + .catch(e => + ok(false, `Wait for browsingContext.isActive failed with ${e}`) + ) + .finally(() => { + requestAnimationFrame(() => setTimeout(() => callback(event), 0), 0); + }); + } + doc.addEventListener("fullscreenchange", onFullscreenChange); +} diff --git a/dom/tests/mochitest/pointerlock/test_closewindow-with-pointerlock.html b/dom/tests/mochitest/pointerlock/test_closewindow-with-pointerlock.html new file mode 100644 index 0000000000..797228c3e0 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/test_closewindow-with-pointerlock.html @@ -0,0 +1,51 @@ + + + + + Bug 1323983 - Auto-close window after holding pointerlock + + + + + + + + diff --git a/dom/tests/mochitest/pointerlock/test_pointerlock-api.html b/dom/tests/mochitest/pointerlock/test_pointerlock-api.html new file mode 100644 index 0000000000..c0fddb5c87 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/test_pointerlock-api.html @@ -0,0 +1,113 @@ + + + + + Test for Bug 633602 + + + + + + + Mozilla Bug 633602 + +
+
+
+      
+    
+ + diff --git a/dom/tests/mochitest/pointerlock/test_pointerlock_focus.html b/dom/tests/mochitest/pointerlock/test_pointerlock_focus.html new file mode 100644 index 0000000000..4b414d3ba6 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/test_pointerlock_focus.html @@ -0,0 +1,111 @@ + + + + + Bug 1646493 - test_pointerlock_focus.html + + + + + + +Mozilla Bug 1646493
+
+
+ + + + diff --git a/dom/tests/mochitest/pointerlock/test_pointerlock_target_not_in_active_document.html b/dom/tests/mochitest/pointerlock/test_pointerlock_target_not_in_active_document.html new file mode 100644 index 0000000000..8629230b6b --- /dev/null +++ b/dom/tests/mochitest/pointerlock/test_pointerlock_target_not_in_active_document.html @@ -0,0 +1,77 @@ + + + + + Bug 1646493 - test_pointerlock_target_not_in_active_document.html + + + + + +Mozilla Bug 1646493
+ + + + diff --git a/dom/tests/mochitest/pointerlock/test_pointerlock_xorigin_iframe.html b/dom/tests/mochitest/pointerlock/test_pointerlock_xorigin_iframe.html new file mode 100644 index 0000000000..fb4f84470e --- /dev/null +++ b/dom/tests/mochitest/pointerlock/test_pointerlock_xorigin_iframe.html @@ -0,0 +1,59 @@ + + + + +Test for Bug 1662587 + + + + + +Mozilla Bug 1662587 +
+
+
+
+ + -- cgit v1.2.3