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

Browser+WebContent+WebDriver: Move Get Title to WebContent

This commit is contained in:
Timothy Flynn 2022-11-11 13:50:43 -05:00 committed by Linus Groh
parent 7f142745e2
commit 2c9549cb76
9 changed files with 18 additions and 27 deletions

View file

@ -539,8 +539,7 @@ Web::WebDriver::Response Client::handle_get_title(Vector<StringView> const& para
{
dbgln_if(WEBDRIVER_DEBUG, "Handling GET /session/<session_id>/title");
auto* session = TRY(find_session_with_id(parameters[0]));
auto result = TRY(session->get_title());
return make_json_value(result);
return session->web_content_connection().get_title();
}
// 11.1 Get Window Handle, https://w3c.github.io/webdriver/#get-window-handle

View file

@ -172,19 +172,6 @@ Web::WebDriver::Response Session::set_timeouts(JsonValue const& payload)
return JsonValue {};
}
// 10.6 Get Title, https://w3c.github.io/webdriver/#dfn-get-title
Web::WebDriver::Response Session::get_title()
{
// 1. If the current top-level browsing context is no longer open, return error with error code no such window.
TRY(check_for_open_top_level_browsing_context_or_return_error());
// FIXME: 2. Handle any user prompts and return its value if it is an error.
// 3. Let title be the initial value of the title IDL attribute of the current top-level browsing context's active document.
// 4. Return success with data title.
return JsonValue(m_browser_connection->get_title());
}
// 11.1 Get Window Handle, https://w3c.github.io/webdriver/#get-window-handle
Web::WebDriver::Response Session::get_window_handle()
{

View file

@ -51,7 +51,6 @@ public:
Web::WebDriver::Response stop();
JsonObject get_timeouts();
Web::WebDriver::Response set_timeouts(JsonValue const& payload);
Web::WebDriver::Response get_title();
Web::WebDriver::Response get_window_handle();
ErrorOr<void, Variant<Web::WebDriver::Error, Error>> close_window();
Web::WebDriver::Response get_window_handles() const;