webdriver: Synchronize "close window" command & Return correct error type (#38620)

1. Synchronize [Close
Window](https://w3c.github.io/webdriver/#dfn-close-window) command to
reduce intermittency
2. There was a update last month exposing that we are not returning
correct error type for Session getter.
https://github.com/web-platform-tests/wpt/pull/53735
3. Other trivial fix

Testing: 
- `/webdriver/tests/classic/close_window/close.py` can now fully pass.
- `/webdriver/tests/classic/delete_session/*` can now fully pass.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
This commit is contained in:
Euclid Ye 2025-08-13 12:06:39 +08:00 committed by GitHub
parent 7fc2f31309
commit 6029976365
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 28 additions and 36 deletions

View file

@ -151,7 +151,7 @@ pub enum WebDriverCommandMsg {
/// associated with the new webview, and sets a "load status sender" if provided.
NewWebView(IpcSender<WebViewId>, Option<IpcSender<WebDriverLoadStatus>>),
/// Close the webview associated with the provided id.
CloseWebView(WebViewId),
CloseWebView(WebViewId, IpcSender<()>),
/// Focus the webview associated with the provided id.
/// Sends back a bool indicating whether the focus was successfully set.
FocusWebView(WebViewId, IpcSender<bool>),