WebDriver: Implement GET /status endpoint

This commit is contained in:
Sam Atkins 2022-10-07 17:17:21 +01:00 committed by Linus Groh
parent 80603f141a
commit a15d32982a

View file

@ -391,8 +391,18 @@ ErrorOr<JsonValue, HttpError> Client::handle_get_status(Vector<StringView>, Json
{ {
dbgln_if(WEBDRIVER_DEBUG, "Handling GET /status"); dbgln_if(WEBDRIVER_DEBUG, "Handling GET /status");
// FIXME: Implement the spec steps // 1. Let body be a new JSON Object with the following properties:
return HttpError { 400, "", "" }; // "ready"
// The remote ends readiness state.
// "message"
// An implementation-defined string explaining the remote ends readiness state.
// FIXME: Report if we are somehow not ready.
JsonObject body;
body.set("ready", true);
body.set("message", "Ready to start some sessions!");
// 2. Return success with data body.
return body;
} }
// POST /session/{session id}/url https://w3c.github.io/webdriver/#dfn-navigate-to // POST /session/{session id}/url https://w3c.github.io/webdriver/#dfn-navigate-to