WebContent+WebDriver: Properly define and invoke stubbed methods
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-22.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-22.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-22.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-22.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run

This commit is contained in:
Timothy Flynn 2024-09-08 08:14:52 -04:00 committed by Tim Flynn
parent d1ba317e22
commit 0a482e1a53
Notes: github-actions[bot] 2024-09-08 13:02:15 +00:00
3 changed files with 29 additions and 10 deletions

View file

@ -596,9 +596,10 @@ Messages::WebDriverClient::NewWindowResponse WebDriverConnection::new_window(Jso
}
// 11.6 Switch To Frame, https://w3c.github.io/webdriver/#dfn-switch-to-frame
Messages::WebDriverClient::SwitchToFrameResponse WebDriverConnection::switch_to_frame()
Messages::WebDriverClient::SwitchToFrameResponse WebDriverConnection::switch_to_frame(JsonValue const&)
{
dbgln("FIXME: WebDriverConnection::switch_to_frame()");
// FIXME: 1. Let id be the result of getting the property "id" from parameters.
// FIXME: 2. If id is not null, a Number object, or an Object that represents a web element, return error with error code invalid argument.
@ -650,10 +651,12 @@ Messages::WebDriverClient::SwitchToFrameResponse WebDriverConnection::switch_to_
// FIXME: 4. Update any implementation-specific state that would result from the user selecting session's current browsing context for interaction, without altering OS-level focus.
// FIXME: 5. Return success with data null
return JsonValue {};
}
// 11.7 Switch To Parent Frame, https://w3c.github.io/webdriver/#dfn-switch-to-parent-frame
Messages::WebDriverClient::SwitchToParentFrameResponse WebDriverConnection::switch_to_parent_frame()
Messages::WebDriverClient::SwitchToParentFrameResponse WebDriverConnection::switch_to_parent_frame(JsonValue const&)
{
dbgln("FIXME: WebDriverConnection::switch_to_parent_frame()");
@ -674,6 +677,8 @@ Messages::WebDriverClient::SwitchToParentFrameResponse WebDriverConnection::swit
// FIXME: 5. Update any implementation-specific state that would result from the user selecting session's current browsing context for interaction, without altering OS-level focus.
// FIXME: 6. Return success with data null.
return JsonValue {};
}
// 11.8.1 Get Window Rect, https://w3c.github.io/webdriver/#dfn-get-window-rect
@ -1509,10 +1514,9 @@ Messages::WebDriverClient::ElementClickResponse WebDriverConnection::element_cli
}
// 12.5.2 Element Clear, https://w3c.github.io/webdriver/#dfn-element-clear
Messages::WebDriverClient::ElementClearResponse WebDriverConnection::element_clear(String const& element_id)
Messages::WebDriverClient::ElementClearResponse WebDriverConnection::element_clear(String const&)
{
dbgln("FIXME: WebDriverConnection::element_clear()");
// To clear a content editable element
// FIXME: 1. If element's innerHTML IDL attribute is an empty string do nothing and return.
@ -1584,13 +1588,14 @@ Messages::WebDriverClient::ElementClearResponse WebDriverConnection::element_cle
}
// FIXME: 12. Return success with data null.
return JsonValue {};
}
// 12.5.3 Element Send Keys, https://w3c.github.io/webdriver/#dfn-element-send-keys
Messages::WebDriverClient::ElementSendKeysResponse WebDriverConnection::element_send_keys(String const& element_id)
Messages::WebDriverClient::ElementSendKeysResponse WebDriverConnection::element_send_keys(String const&)
{
dbgln("FIXME: WebDriverConnection::element_send_keys()");
// To clear the modifier key state given input state, input id, source, undo actions, and browsing context:
// FIXME: 1. If source is not a key input source return error with error code invalid argument.
@ -1809,6 +1814,8 @@ Messages::WebDriverClient::ElementSendKeysResponse WebDriverConnection::element_
// FIXME: 14. Remove an input source with input state and input id.
// FIXME: 15. Return success with data null.
return JsonValue {};
}
// 13.1 Get Page Source, https://w3c.github.io/webdriver/#dfn-get-page-source

View file

@ -56,6 +56,8 @@ private:
virtual Messages::WebDriverClient::CloseWindowResponse close_window() override;
virtual Messages::WebDriverClient::SwitchToWindowResponse switch_to_window() override;
virtual Messages::WebDriverClient::NewWindowResponse new_window(JsonValue const& payload) override;
virtual Messages::WebDriverClient::SwitchToFrameResponse switch_to_frame(JsonValue const& payload) override;
virtual Messages::WebDriverClient::SwitchToParentFrameResponse switch_to_parent_frame(JsonValue const& payload) override;
virtual Messages::WebDriverClient::GetWindowRectResponse get_window_rect() override;
virtual Messages::WebDriverClient::SetWindowRectResponse set_window_rect(JsonValue const& payload) override;
virtual Messages::WebDriverClient::MaximizeWindowResponse maximize_window() override;
@ -81,6 +83,8 @@ private:
virtual Messages::WebDriverClient::GetComputedRoleResponse get_computed_role(String const& element_id) override;
virtual Messages::WebDriverClient::GetComputedLabelResponse get_computed_label(String const& element_id) override;
virtual Messages::WebDriverClient::ElementClickResponse element_click(String const& element_id) override;
virtual Messages::WebDriverClient::ElementClearResponse element_clear(String const& element_id) override;
virtual Messages::WebDriverClient::ElementSendKeysResponse element_send_keys(String const& element_id) override;
virtual Messages::WebDriverClient::GetSourceResponse get_source() override;
virtual Messages::WebDriverClient::ExecuteScriptResponse execute_script(JsonValue const& payload) override;
virtual Messages::WebDriverClient::ExecuteAsyncScriptResponse execute_async_script(JsonValue const& payload) override;

View file

@ -348,14 +348,18 @@ Web::WebDriver::Response Client::new_window(Web::WebDriver::Parameters parameter
// POST /session/{session id}/frame
Web::WebDriver::Response Client::switch_to_frame(Web::WebDriver::Parameters parameters, JsonValue payload)
{
// FIXME
dbgln_if(WEBDRIVER_DEBUG, "Handling POST /session/<session_id>/frame");
auto session = TRY(find_session_with_id(parameters[0]));
return session->web_content_connection().switch_to_frame(move(payload));
}
// 11.7 Switch To Parent Frame, https://w3c.github.io/webdriver/#dfn-switch-to-parent-frame
// POST /session/{session id}/frame/parent
Web::WebDriver::Response Client::switch_to_parent_frame(Web::WebDriver::Parameters parameters, JsonValue payload)
{
// FIXME
dbgln_if(WEBDRIVER_DEBUG, "Handling POST /session/<session_id>/frame/parent");
auto session = TRY(find_session_with_id(parameters[0]));
return session->web_content_connection().switch_to_parent_frame(move(payload));
}
// 11.8.1 Get Window Rect, https://w3c.github.io/webdriver/#dfn-get-window-rect
@ -587,14 +591,18 @@ Web::WebDriver::Response Client::element_click(Web::WebDriver::Parameters parame
// POST /session/{session id}/element/{element id}/clear
Web::WebDriver::Response Client::element_clear(Web::WebDriver::Parameters parameters, JsonValue)
{
// FIXME
dbgln_if(WEBDRIVER_DEBUG, "Handling POST /session/<session_id>/element/<element_id>/clear");
auto session = TRY(find_session_with_id(parameters[0]));
return session->web_content_connection().element_clear(move(parameters[1]));
}
// 12.5.3 Element Send Keys, https://w3c.github.io/webdriver/#dfn-element-send-keys
// POST /session/{session id}/element/{element id}/value
Web::WebDriver::Response Client::element_send_keys(Web::WebDriver::Parameters parameters, JsonValue)
{
// FIXME
dbgln_if(WEBDRIVER_DEBUG, "Handling POST /session/<session_id>/element/<element_id>/value");
auto session = TRY(find_session_with_id(parameters[0]));
return session->web_content_connection().element_send_keys(move(parameters[1]));
}
// 13.1 Get Page Source, https://w3c.github.io/webdriver/#dfn-get-page-source