1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:37:34 +00:00

WebContent+WebDriver: Ensure Get Window Handle checks for closed BCs

This commit is contained in:
Timothy Flynn 2023-03-07 11:29:14 -05:00 committed by Linus Groh
parent 010be9b7c2
commit 0524bc1d13
4 changed files with 13 additions and 2 deletions

View file

@ -290,7 +290,8 @@ Web::WebDriver::Response Client::get_window_handle(Web::WebDriver::Parameters pa
dbgln_if(WEBDRIVER_DEBUG, "Handling GET /session/<session_id>/window");
auto session = TRY(find_session_with_id(parameters[0]));
// FIXME: 1. If the current top-level browsing context is no longer open, return error with error code no such window.
// 1. If the current top-level browsing context is no longer open, return error with error code no such window.
TRY(session->web_content_connection().ensure_top_level_browsing_context_is_open());
// 2. Return success with data being the window handle associated with the current top-level browsing context.
return JsonValue { session->current_window_handle() };