1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 05:27:45 +00:00

LibWeb: Stub out Release Actions

This allows WPT to open the browser, and it no longer instantly crashes
This commit is contained in:
stelar7 2023-06-17 17:36:00 +02:00 committed by Andrew Kaster
parent 3d7e788981
commit 23b378822b
7 changed files with 36 additions and 0 deletions

View file

@ -51,6 +51,7 @@ endpoint WebDriverClient {
add_cookie(JsonValue payload) => (Web::WebDriver::Response response)
delete_cookie(String name) => (Web::WebDriver::Response response)
delete_all_cookies() => (Web::WebDriver::Response response)
release_actions() => (Web::WebDriver::Response response)
dismiss_alert() => (Web::WebDriver::Response response)
accept_alert() => (Web::WebDriver::Response response)
get_alert_text() => (Web::WebDriver::Response response)

View file

@ -1654,6 +1654,26 @@ Messages::WebDriverClient::DeleteAllCookiesResponse WebDriverConnection::delete_
return JsonValue {};
}
// 15.8 Release Actions, https://w3c.github.io/webdriver/#release-actions
Messages::WebDriverClient::ReleaseActionsResponse WebDriverConnection::release_actions()
{
// 1. If the current browsing context is no longer open, return error with error code no such window.
TRY(ensure_open_top_level_browsing_context());
// FIXME: 2. Let input state be the result of get the input state with current session and current top-level browsing context.
// FIXME: 3. Let actions options be a new actions options with the is element origin steps set to represents a web element, and the get element origin steps set to get a WebElement origin.
// FIXME: 4. Let undo actions be input states input cancel list in reverse order.
// FIXME: 5. Try to dispatch tick actions with arguments undo actions, 0, current browsing context, and actions options.
// FIXME: 6. Reset the input state with current session and current top-level browsing context.
// 7. Return success with data null.
return JsonValue {};
}
// 16.1 Dismiss Alert, https://w3c.github.io/webdriver/#dismiss-alert
Messages::WebDriverClient::DismissAlertResponse WebDriverConnection::dismiss_alert()
{

View file

@ -88,6 +88,7 @@ private:
virtual Messages::WebDriverClient::AddCookieResponse add_cookie(JsonValue const& payload) override;
virtual Messages::WebDriverClient::DeleteCookieResponse delete_cookie(String const& name) override;
virtual Messages::WebDriverClient::DeleteAllCookiesResponse delete_all_cookies() override;
virtual Messages::WebDriverClient::ReleaseActionsResponse release_actions() override;
virtual Messages::WebDriverClient::DismissAlertResponse dismiss_alert() override;
virtual Messages::WebDriverClient::AcceptAlertResponse accept_alert() override;
virtual Messages::WebDriverClient::GetAlertTextResponse get_alert_text() override;