mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 02:57:42 +00:00
WebDriver: Fix HTTP Status for 'no such window' error
The 'no such window' error returns a 404, not a 400.
This commit is contained in:
parent
1179d951f6
commit
a33cad1197
1 changed files with 4 additions and 4 deletions
|
@ -74,7 +74,7 @@ ErrorOr<void, Variant<HttpError, Error>> Session::delete_window()
|
|||
// 1. If the current top-level browsing context is no longer open, return error with error code no such window.
|
||||
auto current_window = get_window_object();
|
||||
if (!current_window.has_value())
|
||||
return Variant<HttpError, Error>(HttpError { 400, "no such window", "Window not found" });
|
||||
return Variant<HttpError, Error>(HttpError { 404, "no such window", "Window not found" });
|
||||
|
||||
// 2. Close the current top-level browsing context.
|
||||
m_windows.remove(m_current_window_handle);
|
||||
|
@ -96,7 +96,7 @@ ErrorOr<JsonValue, HttpError> Session::post_url(JsonValue const& payload)
|
|||
// 1. If the current top-level browsing context is no longer open, return error with error code no such window.
|
||||
auto current_window = get_window_object();
|
||||
if (!current_window.has_value())
|
||||
return HttpError { 400, "no such window", "Window not found" };
|
||||
return HttpError { 404, "no such window", "Window not found" };
|
||||
|
||||
// FIXME 2. Handle any user prompts and return its value if it is an error.
|
||||
|
||||
|
@ -132,7 +132,7 @@ ErrorOr<JsonValue, HttpError> Session::get_url()
|
|||
// 1. If the current top-level browsing context is no longer open, return error with error code no such window.
|
||||
auto current_window = get_window_object();
|
||||
if (!current_window.has_value())
|
||||
return HttpError { 400, "no such window", "Window not found" };
|
||||
return HttpError { 404, "no such window", "Window not found" };
|
||||
|
||||
// FIXME: 2. Handle any user prompts and return its value if it is an error.
|
||||
|
||||
|
@ -149,7 +149,7 @@ ErrorOr<JsonValue, HttpError> Session::get_title()
|
|||
// 1. If the current top-level browsing context is no longer open, return error with error code no such window.
|
||||
auto current_window = get_window_object();
|
||||
if (!current_window.has_value())
|
||||
return HttpError { 400, "no such window", "Window not found" };
|
||||
return HttpError { 404, "no such window", "Window not found" };
|
||||
|
||||
// FIXME: 2. Handle any user prompts and return its value if it is an error.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue