From 8939ae8522419c3b7214884dad0b14839d5fa3b3 Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Sun, 22 Sep 2024 18:43:11 +0100 Subject: [PATCH] WebContent: Return errors from unimplemented WebDriver endpoints Previously, some otherwise unimplemented WebDriver endpoints were indicating that they had executed successful, this was causing a large number of Web Platform Tests to time out when they should have failed. --- Userland/Services/WebContent/WebDriverConnection.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Services/WebContent/WebDriverConnection.cpp b/Userland/Services/WebContent/WebDriverConnection.cpp index 0ddf2858464..a6e7f1f6e4f 100644 --- a/Userland/Services/WebContent/WebDriverConnection.cpp +++ b/Userland/Services/WebContent/WebDriverConnection.cpp @@ -1523,7 +1523,7 @@ Messages::WebDriverClient::ElementClearResponse WebDriverConnection::element_cle // FIXME: 12. Return success with data null. - return JsonValue {}; + return Web::WebDriver::Error::from_code(Web::WebDriver::ErrorCode::UnsupportedOperation, "element clear not implemented"sv); } // 12.5.3 Element Send Keys, https://w3c.github.io/webdriver/#dfn-element-send-keys @@ -1749,7 +1749,7 @@ Messages::WebDriverClient::ElementSendKeysResponse WebDriverConnection::element_ // FIXME: 15. Return success with data null. - return JsonValue {}; + return Web::WebDriver::Error::from_code(Web::WebDriver::ErrorCode::UnsupportedOperation, "send keys not implemented"sv); } // 13.1 Get Page Source, https://w3c.github.io/webdriver/#dfn-get-page-source @@ -2046,8 +2046,8 @@ Messages::WebDriverClient::PerformActionsResponse WebDriverConnection::perform_a // FIXME: 6. Dispatch actions with input state, actions by tick, current browsing context, and actions options. If this results in an error return that error. - // 7. Return success with data null. - return JsonValue {}; + // FIXME: 7. Return success with data null. + return Web::WebDriver::Error::from_code(Web::WebDriver::ErrorCode::UnsupportedOperation, "perform actions not implemented"sv); } // 15.8 Release Actions, https://w3c.github.io/webdriver/#release-actions