Bug 256506 - [WPE] Make MiniBrowser quit upon last WebView closed
Summary: [WPE] Make MiniBrowser quit upon last WebView closed
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WPE WebKit (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Lauro Moura
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-08 20:22 PDT by Lauro Moura
Modified: 2023-05-09 07:46 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lauro Moura 2023-05-08 20:22:21 PDT
In WebDriver tests, sometimes the last visible window is closed by issuing the "Delete Session"[1] when leaving the test fixture. This makes the MiniBrowser's "webViewClose" callback to be called, which currently[2] only removes the target webview from the table of currently open webviews. This behavior might leave the browser in a state where there's no open windows, but the application is still alive.

In some WebDriver tests, this seems to make the WPEWebDriver's Session think there is still an AutomationSession alive on the other side and send commands to it, leading the issued commands to hang. More specifically, when closing the browsing contexts[3], if a connection is still "alive", it'll try to issue getWindowHandles[3] on a deleted session as part of the "close-window" algorithm, it seems.

Note: There is another deadlock issue in selenium related to its webserver using non-daemon threads, which should be fixed by bumping - in a separate bug -the imported suite to include an upstream workaround[4].

Patch for both cases are on the way.

[1] https://www.w3.org/TR/webdriver/#delete-session
[2] https://github.com/WebKit/WebKit/blob/dfd1f46364b965f5c2a578e8375a2709e8c6a55f/Tools/MiniBrowser/wpe/main.cpp#L159
[3] https://github.com/WebKit/WebKit/blob/dfd1f46364b965f5c2a578e8375a2709e8c6a55f/Source/WebDriver/Session.cpp#L534
[4] https://github.com/SeleniumHQ/selenium/commit/d6d672cd93c5cfe57e84c0b17d907bdfd7a3ea2a
Comment 1 Lauro Moura 2023-05-08 20:26:10 PDT
Pull request: https://github.com/WebKit/WebKit/pull/13622
Comment 2 EWS 2023-05-09 07:46:32 PDT
Committed 263864@main (88bec55a6d84): <https://commits.webkit.org/263864@main>

Reviewed commits have been landed. Closing PR #13622 and removing active labels.