From 7146c33522943f90164cd6bee6c6d6897763b772 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Sun, 19 Mar 2023 13:52:14 +0300 Subject: [PATCH] WebDriver: Close all WebContent connections while destroying a session While closing a session, it is necessary to close all windows that may have been opened during that session. --- Userland/Services/WebDriver/Session.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Userland/Services/WebDriver/Session.cpp b/Userland/Services/WebDriver/Session.cpp index 9a04bf9b4f..f18303eaae 100644 --- a/Userland/Services/WebDriver/Session.cpp +++ b/Userland/Services/WebDriver/Session.cpp @@ -34,7 +34,9 @@ Session::~Session() // 1. Perform the following substeps based on the remote end’s type: // NOTE: We perform the "Remote end is an endpoint node" steps in the WebContent process. - web_content_connection().close_session(); + for (auto& it : m_windows) { + it.value.web_content_connection->close_session(); + } // 2. Remove the current session from active sessions. // NOTE: We are in a session destruction which means it is already removed