1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 00:37:34 +00:00

WebContent+WebDriver: Move Get/Set Timeouts to WebContent

This commit is contained in:
Timothy Flynn 2022-11-11 14:28:57 -05:00 committed by Linus Groh
parent cb4b9108d1
commit 04f41bda52
6 changed files with 33 additions and 33 deletions

View file

@ -241,6 +241,29 @@ void WebDriverConnection::set_is_webdriver_active(bool is_webdriver_active)
m_page_host.set_is_webdriver_active(is_webdriver_active);
}
// 9.1 Get Timeouts, https://w3c.github.io/webdriver/#dfn-get-timeouts
Messages::WebDriverClient::GetTimeoutsResponse WebDriverConnection::get_timeouts()
{
// 1. Let timeouts be the timeouts object for sessions timeouts configuration
auto timeouts = Web::WebDriver::timeouts_object(m_timeouts_configuration);
// 2. Return success with data timeouts.
return timeouts;
}
// 9.2 Set Timeouts, https://w3c.github.io/webdriver/#dfn-set-timeouts
Messages::WebDriverClient::SetTimeoutsResponse WebDriverConnection::set_timeouts(JsonValue const& payload)
{
// 1. Let timeouts be the result of trying to JSON deserialize as a timeouts configuration the requests parameters.
auto timeouts = TRY(Web::WebDriver::json_deserialize_as_a_timeouts_configuration(payload));
// 2. Make the session timeouts the new timeouts.
m_timeouts_configuration = move(timeouts);
// 3. Return success with data null.
return JsonValue {};
}
// 10.1 Navigate To, https://w3c.github.io/webdriver/#navigate-to
Messages::WebDriverClient::NavigateToResponse WebDriverConnection::navigate_to(JsonValue const& payload)
{