mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-19 16:59:47 +00:00
LibWeb+WebContent+WebDriver: Asynchronously wait for dialog dismissal
There was a timing issue here where WebDriver would dismiss a dialog, and then invoke another endpoint before the dialog was actually closed. This is because the dismissal first has to hop over to the UI process to close the graphical dialog, which then asynchronously informs WebContent of the result. It's not until WebContent receives that result that the dialog is considered closed, thus those subsequent endpoints would abort due a dialog being "open". We now wait for dialogs to be fully closed before returning from the dismissal endpoints.
This commit is contained in:
parent
bf0bc62654
commit
0722a3b1c0
Notes:
github-actions[bot]
2024-10-26 09:26:38 +00:00
Author: https://github.com/trflynn89
Commit: 0722a3b1c0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1967
9 changed files with 60 additions and 14 deletions
|
@ -243,4 +243,18 @@ Web::WebDriver::Response Session::perform_actions(JsonValue payload) const
|
|||
});
|
||||
}
|
||||
|
||||
Web::WebDriver::Response Session::dismiss_alert() const
|
||||
{
|
||||
return perform_async_action(web_content_connection().on_dialog_closed, [&]() {
|
||||
return web_content_connection().dismiss_alert();
|
||||
});
|
||||
}
|
||||
|
||||
Web::WebDriver::Response Session::accept_alert() const
|
||||
{
|
||||
return perform_async_action(web_content_connection().on_dialog_closed, [&]() {
|
||||
return web_content_connection().accept_alert();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue