summaryrefslogtreecommitdiff
path: root/Userland/Services/WebDriver
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-10-17 16:25:23 +0200
committerLinus Groh <mail@linusgroh.de>2022-10-17 18:20:05 +0200
commit8b5b42f667527fe9d304cf597907897cce4a3d32 (patch)
tree41cdaa013c2b488cfa22e26aabd399b50f7d7d2e /Userland/Services/WebDriver
parent324eb98bb9bd2d95de4fe166e3e317fe5585e3b2 (diff)
downloadserenity-8b5b42f667527fe9d304cf597907897cce4a3d32.zip
WebDriver: Replace `Session* session = ...` with `auto* session = ...`
Diffstat (limited to 'Userland/Services/WebDriver')
-rw-r--r--Userland/Services/WebDriver/Client.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/Userland/Services/WebDriver/Client.cpp b/Userland/Services/WebDriver/Client.cpp
index f95eb2eda3..dc0ab742e6 100644
--- a/Userland/Services/WebDriver/Client.cpp
+++ b/Userland/Services/WebDriver/Client.cpp
@@ -386,7 +386,7 @@ ErrorOr<JsonValue, HttpError> Client::handle_delete_session(Vector<StringView> c
dbgln_if(WEBDRIVER_DEBUG, "Handling DELETE /session/<session_id>");
// 1. If the current session is an active session, try to close the session.
- Session* session = TRY(find_session_with_id(parameters[0]));
+ auto* session = TRY(find_session_with_id(parameters[0]));
auto stop_result = session->stop();
if (stop_result.is_error()) {
@@ -422,7 +422,7 @@ ErrorOr<JsonValue, HttpError> Client::handle_get_status(Vector<StringView> const
ErrorOr<JsonValue, HttpError> Client::handle_post_url(Vector<StringView> const& parameters, JsonValue const& payload)
{
dbgln_if(WEBDRIVER_DEBUG, "Handling POST /session/<session_id>/url");
- Session* session = TRY(find_session_with_id(parameters[0]));
+ auto* session = TRY(find_session_with_id(parameters[0]));
// NOTE: Spec steps handled in Session::post_url().
auto result = TRY(session->post_url(payload));
@@ -434,7 +434,7 @@ ErrorOr<JsonValue, HttpError> Client::handle_post_url(Vector<StringView> const&
ErrorOr<JsonValue, HttpError> Client::handle_get_url(Vector<StringView> const& parameters, JsonValue const&)
{
dbgln_if(WEBDRIVER_DEBUG, "Handling GET /session/<session_id>/url");
- Session* session = TRY(find_session_with_id(parameters[0]));
+ auto* session = TRY(find_session_with_id(parameters[0]));
// NOTE: Spec steps handled in Session::get_url().
auto result = TRY(session->get_url());
@@ -446,7 +446,7 @@ ErrorOr<JsonValue, HttpError> Client::handle_get_url(Vector<StringView> const& p
ErrorOr<JsonValue, HttpError> Client::handle_back(Vector<StringView> const& parameters, JsonValue const&)
{
dbgln_if(WEBDRIVER_DEBUG, "Handling POST /session/<session_id>/back");
- Session* session = TRY(find_session_with_id(parameters[0]));
+ auto* session = TRY(find_session_with_id(parameters[0]));
// NOTE: Spec steps handled in Session::back().
auto result = TRY(session->back());
@@ -458,7 +458,7 @@ ErrorOr<JsonValue, HttpError> Client::handle_back(Vector<StringView> const& para
ErrorOr<JsonValue, HttpError> Client::handle_forward(Vector<StringView> const& parameters, JsonValue const&)
{
dbgln_if(WEBDRIVER_DEBUG, "Handling POST /session/<session_id>/forward");
- Session* session = TRY(find_session_with_id(parameters[0]));
+ auto* session = TRY(find_session_with_id(parameters[0]));
// NOTE: Spec steps handled in Session::forward().
auto result = TRY(session->forward());
@@ -470,7 +470,7 @@ ErrorOr<JsonValue, HttpError> Client::handle_forward(Vector<StringView> const& p
ErrorOr<JsonValue, HttpError> Client::handle_refresh(Vector<StringView> const& parameters, JsonValue const&)
{
dbgln_if(WEBDRIVER_DEBUG, "Handling POST /session/<session_id>/refresh");
- Session* session = TRY(find_session_with_id(parameters[0]));
+ auto* session = TRY(find_session_with_id(parameters[0]));
// NOTE: Spec steps handled in Session::refresh().
auto result = TRY(session->refresh());
@@ -482,7 +482,7 @@ ErrorOr<JsonValue, HttpError> Client::handle_refresh(Vector<StringView> const& p
ErrorOr<JsonValue, HttpError> Client::handle_get_title(Vector<StringView> const& parameters, JsonValue const&)
{
dbgln_if(WEBDRIVER_DEBUG, "Handling GET /session/<session_id>/title");
- Session* session = TRY(find_session_with_id(parameters[0]));
+ auto* session = TRY(find_session_with_id(parameters[0]));
// NOTE: Spec steps handled in Session::get_title().
auto result = TRY(session->get_title());
@@ -495,7 +495,7 @@ ErrorOr<JsonValue, HttpError> Client::handle_get_title(Vector<StringView> const&
ErrorOr<JsonValue, HttpError> Client::handle_delete_window(Vector<StringView> const& parameters, JsonValue const&)
{
dbgln_if(WEBDRIVER_DEBUG, "Handling DELETE /session/<session_id>/window");
- Session* session = TRY(find_session_with_id(parameters[0]));
+ auto* session = TRY(find_session_with_id(parameters[0]));
// NOTE: Spec steps handled in Session::delete_window().
TRY(unwrap_result(session->delete_window()));
@@ -508,7 +508,7 @@ ErrorOr<JsonValue, HttpError> Client::handle_delete_window(Vector<StringView> co
ErrorOr<JsonValue, HttpError> Client::handle_get_all_cookies(Vector<StringView> const& parameters, JsonValue const&)
{
dbgln_if(WEBDRIVER_DEBUG, "Handling GET /session/<session_id>/cookie");
- Session* session = TRY(find_session_with_id(parameters[0]));
+ auto* session = TRY(find_session_with_id(parameters[0]));
// NOTE: Spec steps handled in Session::get_all_cookies().
auto cookies = TRY(session->get_all_cookies());
@@ -521,7 +521,7 @@ ErrorOr<JsonValue, HttpError> Client::handle_get_all_cookies(Vector<StringView>
ErrorOr<JsonValue, HttpError> Client::handle_get_named_cookie(Vector<StringView> const& parameters, JsonValue const&)
{
dbgln_if(WEBDRIVER_DEBUG, "Handling GET /session/<session_id>/cookie/<name>");
- Session* session = TRY(find_session_with_id(parameters[0]));
+ auto* session = TRY(find_session_with_id(parameters[0]));
// NOTE: Spec steps handled in Session::get_all_cookies().
auto cookies = TRY(session->get_named_cookie(parameters[1]));
@@ -534,7 +534,7 @@ ErrorOr<JsonValue, HttpError> Client::handle_get_named_cookie(Vector<StringView>
ErrorOr<JsonValue, HttpError> Client::handle_add_cookie(Vector<StringView> const& parameters, JsonValue const& payload)
{
dbgln_if(WEBDRIVER_DEBUG, "Handling POST /session/<session_id>/cookie");
- Session* session = TRY(find_session_with_id(parameters[0]));
+ auto* session = TRY(find_session_with_id(parameters[0]));
// NOTE: Spec steps handled in Session::add_cookie().
auto result = TRY(session->add_cookie(payload));
@@ -546,7 +546,7 @@ ErrorOr<JsonValue, HttpError> Client::handle_add_cookie(Vector<StringView> const
ErrorOr<JsonValue, HttpError> Client::handle_delete_cookie(Vector<StringView> const& parameters, JsonValue const&)
{
dbgln_if(WEBDRIVER_DEBUG, "Handling DELETE /session/<session_id>/cookie/<name>");
- Session* session = TRY(find_session_with_id(parameters[0]));
+ auto* session = TRY(find_session_with_id(parameters[0]));
// NOTE: Spec steps handled in Session::delete_cookie().
auto result = TRY(session->delete_cookie(parameters[1]));
@@ -558,7 +558,7 @@ ErrorOr<JsonValue, HttpError> Client::handle_delete_cookie(Vector<StringView> co
ErrorOr<JsonValue, HttpError> Client::handle_delete_all_cookies(Vector<StringView> const& parameters, JsonValue const&)
{
dbgln_if(WEBDRIVER_DEBUG, "Handling DELETE /session/<session_id>/cookie");
- Session* session = TRY(find_session_with_id(parameters[0]));
+ auto* session = TRY(find_session_with_id(parameters[0]));
// NOTE: Spec steps handled in Session::delete_all_cookies().
auto result = TRY(session->delete_all_cookies());