tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 4f8cd0f4297c2a2091ba6930d848c766b6385d31
parent 44d9b560e234f75666c2d90c0cea51579b5aaebf
Author: Henrik Skupin <mail@hskupin.info>
Date:   Wed, 29 Oct 2025 10:05:36 +0000

Bug 1996540 - [marionette] Throw "no such frame" error for invalid frame id when deserializing WebFrame objects. r=jdescottes

Differential Revision: https://phabricator.services.mozilla.com/D270127

Diffstat:
Mremote/marionette/driver.sys.mjs | 8++++++--
Mremote/marionette/json.sys.mjs | 6+++++-
Mtesting/web-platform/meta/webdriver/tests/classic/execute_async_script/arguments.py.ini | 2--
Dtesting/web-platform/meta/webdriver/tests/classic/execute_script/arguments.py.ini | 3---
4 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/remote/marionette/driver.sys.mjs b/remote/marionette/driver.sys.mjs @@ -961,8 +961,10 @@ GeckoDriver.prototype.getContext = function () { * If an {@link Error} was thrown whilst evaluating the script. * @throws {NoSuchElementError} * If an element that was passed as part of <var>args</var> is unknown. + * @throws {NoSuchFrameError} + * Child browsing context has been discarded. * @throws {NoSuchWindowError} - * Browsing context has been discarded. + * Top-level browsing context has been discarded. * @throws {ScriptTimeoutError} * If the script was interrupted due to reaching the session's * script timeout. @@ -1034,8 +1036,10 @@ GeckoDriver.prototype.executeScript = function (cmd) { * If an Error was thrown whilst evaluating the script. * @throws {NoSuchElementError} * If an element that was passed as part of <var>args</var> is unknown. + * @throws {NoSuchFrameError} + * Child browsing context has been discarded. * @throws {NoSuchWindowError} - * Browsing context has been discarded. + * Top-level browsing context has been discarded. * @throws {ScriptTimeoutError} * If the script was interrupted due to reaching the session's * script timeout. diff --git a/remote/marionette/json.sys.mjs b/remote/marionette/json.sys.mjs @@ -230,6 +230,10 @@ json.clone = function (value, nodeCache) { * * @throws {NoSuchElementError} * If the WebElement reference has not been seen before. + * @throws {NoSuchFrameError} + * Child browsing context has been discarded. + * @throws {NoSuchWindowError} + * Top-level browsing context has been discarded. * @throws {StaleElementReferenceError} * If the element is stale, indicating it is no longer attached to the DOM. */ @@ -267,7 +271,7 @@ json.deserialize = function (value, nodeCache, browsingContext) { const browsingContext = BrowsingContext.get(webRef.uuid); if (browsingContext === null || browsingContext.parent === null) { - throw new lazy.error.NoSuchWindowError( + throw new lazy.error.NoSuchFrameError( `Unable to locate frame with id: ${webRef.uuid}` ); } diff --git a/testing/web-platform/meta/webdriver/tests/classic/execute_async_script/arguments.py.ini b/testing/web-platform/meta/webdriver/tests/classic/execute_async_script/arguments.py.ini @@ -1,5 +1,3 @@ [arguments.py] expected: if (os == "linux") and debug and (display == "x11") and fission: [OK, ERROR, TIMEOUT] - [test_no_such_frame_for_frame_with_invalid_value] - expected: FAIL diff --git a/testing/web-platform/meta/webdriver/tests/classic/execute_script/arguments.py.ini b/testing/web-platform/meta/webdriver/tests/classic/execute_script/arguments.py.ini @@ -1,3 +0,0 @@ -[arguments.py] - [test_no_such_frame_for_frame_with_invalid_value] - expected: FAIL