tor-browser

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

commit 96091308edff51b6c0e79dae25ea27bc2b9f8609
parent 39fc883d958977dda5a0631f95bb1281c91ab5cd
Author: Euclid Ye <yezhizhenjiakang@gmail.com>
Date:   Tue, 21 Oct 2025 10:32:09 +0000

Bug 1994639 [wpt PR 55471] - webdriver: Deserialize `WebFrame` and report error correctly for script execution + Fix wrong tests, a=testonly

Automatic update from web-platform-tests
Async script: Test "no such frame" instead of "no such window" for WebFrame

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>

--
Execute Script:Test "no such frame" instead of "no such window" for WebFrame

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>

--
Fix WPT Lint

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>

--

wpt-commits: 2038228be54f25d36e146feb7006cd1c4f8f5d25, ea1171d7ef1164b860339333c142dc4a225f4195, 38f33bf2d187b15f407465488790dee2bda48c5e
wpt-pr: 55471

Diffstat:
Mtesting/web-platform/tests/webdriver/tests/classic/execute_async_script/arguments.py | 19++++++++++++++++---
Mtesting/web-platform/tests/webdriver/tests/classic/execute_script/arguments.py | 19++++++++++++++++---
2 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/testing/web-platform/tests/webdriver/tests/classic/execute_async_script/arguments.py b/testing/web-platform/tests/webdriver/tests/classic/execute_async_script/arguments.py @@ -181,11 +181,24 @@ def test_no_such_window_for_window_with_invalid_value(session, get_test_page): assert isinstance(frame, WebFrame) window_reference = WebWindow(session, frame.id) + + result = execute_async_script(session, "arguments[1](true)", args=(window_reference,)) + assert_error(result, "no such window") + + +def test_no_such_frame_for_frame_with_invalid_value(session, get_test_page): + session.url = get_test_page() + + result = execute_async_script(session, "arguments[0]([window, window.frames[0]]);") + [window, frame] = assert_success(result) + + assert isinstance(window, WebWindow) + assert isinstance(frame, WebFrame) + frame_reference = WebFrame(session, window.id) - for reference in [window_reference, frame_reference]: - result = execute_async_script(session, "arguments[1](true)", args=(reference,)) - assert_error(result, "no such window") + result = execute_async_script(session, "arguments[1](true)", args=(frame_reference,)) + assert_error(result, "no such frame") @pytest.mark.parametrize("expression, expected_type", [ diff --git a/testing/web-platform/tests/webdriver/tests/classic/execute_script/arguments.py b/testing/web-platform/tests/webdriver/tests/classic/execute_script/arguments.py @@ -169,11 +169,24 @@ def test_no_such_window_for_window_with_invalid_value(session, get_test_page): assert isinstance(frame, WebFrame) window_reference = WebWindow(session, frame.id) + + result = execute_script(session, "return true", args=(window_reference,)) + assert_error(result, "no such window") + + +def test_no_such_frame_for_frame_with_invalid_value(session, get_test_page): + session.url = get_test_page() + + result = execute_script(session, "return [window, window.frames[0]];") + [window, frame] = assert_success(result) + + assert isinstance(window, WebWindow) + assert isinstance(frame, WebFrame) + frame_reference = WebFrame(session, window.id) - for reference in [window_reference, frame_reference]: - result = execute_script(session, "return true", args=(reference,)) - assert_error(result, "no such window") + result = execute_script(session, "return true", args=(frame_reference,)) + assert_error(result, "no such frame") @pytest.mark.parametrize("expression, expected_type", [