From 21a79f7bdfad93f23c8d6e6dc25cd3a2178ef09c Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 10 Apr 2024 11:06:56 +0300 Subject: [PATCH] Micro-optimization of the window closing inside the shared session strategy --- library/aik099/PHPUnit/Session/SharedSessionStrategy.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/aik099/PHPUnit/Session/SharedSessionStrategy.php b/library/aik099/PHPUnit/Session/SharedSessionStrategy.php index 89bb8cd..0fccc57 100644 --- a/library/aik099/PHPUnit/Session/SharedSessionStrategy.php +++ b/library/aik099/PHPUnit/Session/SharedSessionStrategy.php @@ -98,7 +98,7 @@ protected function stopAndForgetSession() */ private function _switchToMainWindow() { - $this->_session->switchToWindow(); + $this->_session->switchToWindow(); // Switch to the window before attempting to execute any window-based calls. $actual_initial_window_name = $this->_session->getWindowName(); // Account for initial window rename. foreach ( $this->_session->getWindowNames() as $name ) { @@ -108,8 +108,9 @@ private function _switchToMainWindow() $this->_session->switchToWindow($name); $this->_session->executeScript('window.close();'); - $this->_session->switchToWindow(); } + + $this->_session->switchToWindow(); } /**