commit 45d5dc256cb4a1c56966d0436580c5d733bf1578
parent 91243215fb3e96e48efd5dde4d4358c3dd20e446
Author: Euclid <yezhizhenjiakang@gmail.com>
Date: Tue, 21 Oct 2025 10:36:42 +0000
Bug 1995125 [wpt PR 55527] - webdriver: Report error instead of panic for invalid `WebElement`&`ShadowRoot` reference , a=testonly
Automatic update from web-platform-tests
Test invalid reference type for WebElement and ShadowRoot
Signed-off-by: Euclid <yezhizhenjiakang@gmail.com>
--
wpt-commits: eb8fc3b283ca4bc6c6f141b18850647a1b96d910
wpt-pr: 55527
Diffstat:
2 files changed, 4 insertions(+), 4 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
@@ -162,9 +162,9 @@ def test_stale_element_reference(session, stale_element, as_frame):
assert_error(result, "stale element reference")
-@pytest.mark.parametrize("type", [WebFrame, WebWindow], ids=["frame", "window"])
+@pytest.mark.parametrize("type", [WebFrame, WebWindow, WebElement, ShadowRoot], ids=["frame", "window", "element", "shadow_root"])
@pytest.mark.parametrize("value", [None, False, 42, [], {}])
-def test_invalid_argument_for_window_with_invalid_type(session, type, value):
+def test_invalid_argument_for_reference_with_invalid_type(session, type, value):
reference = type(session, value)
result = execute_async_script(session, "arguments[1](true)", args=(reference,))
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
@@ -150,9 +150,9 @@ def test_stale_element_reference(session, stale_element, as_frame):
assert_error(result, "stale element reference")
-@pytest.mark.parametrize("type", [WebFrame, WebWindow], ids=["frame", "window"])
+@pytest.mark.parametrize("type", [WebFrame, WebWindow, WebElement, ShadowRoot], ids=["frame", "window", "element", "shadow_root"])
@pytest.mark.parametrize("value", [None, False, 42, [], {}])
-def test_invalid_argument_for_window_with_invalid_type(session, type, value):
+def test_invalid_argument_for_reference_with_invalid_type(session, type, value):
reference = type(session, value)
result = execute_script(session, "return true", args=(reference,))