diff options
Diffstat (limited to 'Userland/Services/WebDriver/Client.cpp')
-rw-r--r-- | Userland/Services/WebDriver/Client.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Userland/Services/WebDriver/Client.cpp b/Userland/Services/WebDriver/Client.cpp index 0ba89fecff..fd6a1e223c 100644 --- a/Userland/Services/WebDriver/Client.cpp +++ b/Userland/Services/WebDriver/Client.cpp @@ -39,6 +39,7 @@ Vector<Client::Route> Client::s_routes = { { HTTP::HttpRequest::Method::GET, { "session", ":session_id", "window", "rect" }, &Client::handle_get_window_rect }, { HTTP::HttpRequest::Method::POST, { "session", ":session_id", "window", "rect" }, &Client::handle_set_window_rect }, { HTTP::HttpRequest::Method::POST, { "session", ":session_id", "window", "maximize" }, &Client::handle_maximize_window }, + { HTTP::HttpRequest::Method::POST, { "session", ":session_id", "window", "minimize" }, &Client::handle_minimize_window }, { HTTP::HttpRequest::Method::POST, { "session", ":session_id", "element" }, &Client::handle_find_element }, { HTTP::HttpRequest::Method::POST, { "session", ":session_id", "elements" }, &Client::handle_find_elements }, { HTTP::HttpRequest::Method::POST, { "session", ":session_id", "element", ":element_id", "element" }, &Client::handle_find_element_from_element }, @@ -576,6 +577,16 @@ ErrorOr<JsonValue, WebDriverError> Client::handle_maximize_window(Vector<StringV return make_json_value(result); } +// 11.8.4 Minimize Window, https://w3c.github.io/webdriver/#minimize-window +// POST /session/{session id}/window/minimize +ErrorOr<JsonValue, WebDriverError> Client::handle_minimize_window(Vector<StringView> const& parameters, JsonValue const&) +{ + dbgln_if(WEBDRIVER_DEBUG, "Handling POST /session/<session_id>/window/minimize"); + auto* session = TRY(find_session_with_id(parameters[0])); + auto result = TRY(session->minimize_window()); + return make_json_value(result); +} + // 12.3.2 Find Element, https://w3c.github.io/webdriver/#dfn-find-element // POST /session/{session id}/element ErrorOr<JsonValue, WebDriverError> Client::handle_find_element(Vector<StringView> const& parameters, JsonValue const& payload) |