Skip to content

[WebDriver][BiDi] Fix browsingContext.close error reported when the window is already closed #47280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lauromoura
Copy link
Contributor

@lauromoura lauromoura commented Jun 27, 2025

48aeb9c

[WebDriver][BiDi] Fix browsingContext.close error reported when the window is already closed
https://bugs.webkit.org/show_bug.cgi?id=295084

Reviewed by NOBODY (OOPS!).

Currently, `browsingContext.close` delegates its implementation to the
WebDriver classic's "close browsing context" command, which returns "no
such window" if we don't have a selected top level context.

BiDi, on the other hand: "If there is no navigable with navigable id
navigable id return error with error code no such frame"

Once we move away from the Classic implementation, we might want to wrap
this in a `getNavigable` helper wrapping BiDi details.

* Source/WebKit/UIProcess/Automation/BidiBrowsingContextAgent.cpp:
(WebKit::BidiBrowsingContextAgent::close):

48aeb9c

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ⏳ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🛠 wpe-cairo
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 playstation
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

…indow is already closed

https://bugs.webkit.org/show_bug.cgi?id=295084

Reviewed by NOBODY (OOPS!).

Currently, `browsingContext.close` delegates its implementation to the
WebDriver classic's "close browsing context" command, which returns "no
such window" if we don't have a selected top level context.

BiDi, on the other hand: "If there is no navigable with navigable id
navigable id return error with error code no such frame"

Once we move away from the Classic implementation, we might want to wrap
this in a `getNavigable` helper wrapping BiDi details.

* Source/WebKit/UIProcess/Automation/BidiBrowsingContextAgent.cpp:
(WebKit::BidiBrowsingContextAgent::close):
@lauromoura lauromoura requested a review from cdumez as a code owner June 27, 2025 05:09
@lauromoura lauromoura self-assigned this Jun 27, 2025
@lauromoura lauromoura added the WebDriver Bugs in WebDriver label Jun 27, 2025
@lauromoura lauromoura requested a review from burg June 27, 2025 05:11
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merging-blocked Applied to prevent a change from being merged WebDriver Bugs in WebDriver
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants