Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r221808 - WebDriver: ensure we close all windows handles when c…
…losing the session https://bugs.webkit.org/show_bug.cgi?id=176508 Reviewed by Brian Burg. The spec says that when closing the session all top level browsing contexts should be closed. We are currently checking if we have an active top level browsing context and then we try to close it before trying with the rest. It can happen that we are in an inconsistent state, for example if the current top level browsing context has been closed by JavaScript or another action and the user didn't switch to another one before closing the session. In such case, closing the session will fail with NoSuchwindow and any other window open will not be closed. It's safer to always ask for all window handles and close them, which is what the spec says too. * Session.cpp: (WebDriver::firstWindowHandleInResult): Helper class to get the first window handle in the result array. (WebDriver::Session::closeAllToplevelBrowsingContexts): Use firstWindowHandleInResult(). (WebDriver::Session::close): Close the current top level browsing context and get all window handles to close them all if needed.
- Loading branch information
1 parent
671e24e
commit 0bd8aa5
Showing
2 changed files
with
46 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters