1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 02:44:58 +00:00

WebDriver: Mark current window handle as invalid after close_window()

This commit is contained in:
Andrew Kaster 2024-02-12 17:37:42 -07:00 committed by Andreas Kling
parent 2b3bc2654f
commit bc87a48e0b

View file

@ -119,7 +119,7 @@ Web::WebDriver::Response Session::close_window()
{
{
// Defer removing the window handle from this session until after we know we are done with its connection.
ScopeGuard guard { [this] { m_windows.remove(m_current_window_handle); } };
ScopeGuard guard { [this] { m_windows.remove(m_current_window_handle); m_current_window_handle = "NoSuchWindowPleaseSelectANewOne"_string; } };
// 3. Close the current top-level browsing context.
TRY(web_content_connection().close_window());