mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:17:36 +00:00
WebDriver: Do not throw an error when closing an inactive session
The spec states to only try to close the session *if* it exists. This situation can occur when closing a session after a Close Window command, as the session will be closed automatically if it was the last window.
This commit is contained in:
parent
12015a4db6
commit
010be9b7c2
1 changed files with 2 additions and 2 deletions
|
@ -184,8 +184,8 @@ Web::WebDriver::Response Client::delete_session(Web::WebDriver::Parameters param
|
||||||
dbgln_if(WEBDRIVER_DEBUG, "Handling DELETE /session/<session_id>");
|
dbgln_if(WEBDRIVER_DEBUG, "Handling DELETE /session/<session_id>");
|
||||||
|
|
||||||
// 1. If the current session is an active session, try to close the session.
|
// 1. If the current session is an active session, try to close the session.
|
||||||
auto session = TRY(find_session_with_id(parameters[0]));
|
if (auto session = find_session_with_id(parameters[0]); !session.is_error())
|
||||||
TRY(session->stop());
|
TRY(session.value()->stop());
|
||||||
|
|
||||||
// 2. Return success with data null.
|
// 2. Return success with data null.
|
||||||
return JsonValue {};
|
return JsonValue {};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue