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
Notes: sideshowbarker 2024-07-17 01:06:10 +09:00

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());