webdriver: Implement the "Get Window Handles" command (#38622)

Implment get window handles according to
[spec](https://w3c.github.io/webdriver/#dfn-window-handles).
- Window handles are supposed to identify `browsing context`. However,
based on `get window handle command` and `get window handles command`,
we only need to care about top level browsing context.
- Back then, we use a random generated uuid for eacch webview id, it is
not correct but still work because all commands depend on `webview id`
and `browsing context id`. The only case we need window handle is is
when webdriver gets window object with js script. Since the object is
converted to the id of window's document node, `get window handle`
should return the same thing.

Action run (with updated expectation):
https://github.com/longvatrong111/servo/actions/runs/16957610535
https://github.com/longvatrong111/servo/actions/runs/16957612027

Some tests may sporadically timeout due to unstable hit test.

cc: @xiaochengh

---------

Signed-off-by: batu_hoang <hoang.binh.trong@huawei.com>
This commit is contained in:
batu_hoang 2025-08-15 11:30:56 +08:00 committed by GitHub
parent dafb0abf31
commit f24f225db8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 116 additions and 98 deletions

View file

@ -1,18 +1,3 @@
[accept.py]
[test_no_top_level_browsing_context]
expected: ERROR
[test_no_browsing_context]
expected: ERROR
[test_accept_alert]
expected: FAIL
[test_accept_confirm]
expected: FAIL
[test_accept_prompt]
expected: FAIL
[test_accept_in_popup_window]
expected: FAIL

View file

@ -1,18 +1,3 @@
[dismiss.py]
[test_no_top_browsing_context]
expected: ERROR
[test_dismiss_confirm]
expected: FAIL
[test_dismiss_prompt]
expected: FAIL
[test_dismiss_in_popup_window]
expected: FAIL
[test_no_browsing_context]
expected: ERROR
[test_dismiss_alert]
expected: FAIL

View file

@ -1,24 +1,12 @@
[navigate.py]
[test_link_from_toplevel_context_with_target[_blank\]]
expected: FAIL
[test_link_from_nested_context_with_target[\]]
expected: FAIL
[test_link_from_nested_context_with_target[_parent\]]
expected: FAIL
[test_link_from_nested_context_with_target[_self\]]
expected: FAIL
[test_link_from_nested_context_with_target[_top\]]
expected: FAIL
[test_link_from_toplevel_context_with_target[_parent\]]
expected: FAIL
[test_link_from_nested_context_with_target[_blank\]]
expected: FAIL
[test_link_closes_window]
expected: FAIL

View file

@ -1,6 +0,0 @@
[window.py]
[test_web_reference[window\]]
expected: FAIL
[test_window_open]
expected: FAIL

View file

@ -1,15 +1,3 @@
[window.py]
[test_web_reference[window\]]
expected: FAIL
[test_web_reference_in_array[window\]]
expected: FAIL
[test_web_reference_in_object[window\]]
expected: FAIL
[test_window_open]
expected: FAIL
[test_same_id_after_cross_origin_navigation]
expected: FAIL

View file

@ -4,6 +4,3 @@
[test_control_click[\\ue051-ctrlKey\]]
expected: FAIL
[test_release_control_click]
expected: FAIL

View file

@ -2,9 +2,6 @@
[test_chained_alert_element_not_interactable[alert\]]
expected: FAIL
[test_chained_alert_element_not_interactable[confirm\]]
expected: FAIL
[test_send_alert_text[\]]
expected: FAIL
@ -16,6 +13,3 @@
[test_send_alert_text[Fed\\terer\]]
expected: FAIL
[test_unexpected_alert]
expected: FAIL