Bug 1455282 - [wdclient] End session if no more windows are open. r=ato
authorHenrik Skupin <mail@hskupin.info>
Thu, 19 Apr 2018 22:40:07 +0200
changeset 471344 e60e61507ef4a95ab2456d13126f6fef9086109a
parent 471343 1af032ceb563b6eedebc3954391db86a5a169677
child 471345 90908c3a6f9ede9a0c541dedecbd74a4a34807e3
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1455282
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1455282 - [wdclient] End session if no more windows are open. r=ato After closing the last top-level browsing context, the session will be closed too. MozReview-Commit-ID: CVsJpHO34BM
testing/web-platform/tests/tools/webdriver/webdriver/client.py
--- a/testing/web-platform/tests/tools/webdriver/webdriver/client.py
+++ b/testing/web-platform/tests/tools/webdriver/webdriver/client.py
@@ -531,17 +531,22 @@ class Session(object):
         else:
             url = "frame"
             body = {"id": frame}
 
         return self.send_session_command("POST", url, body)
 
     @command
     def close(self):
-        return self.send_session_command("DELETE", "window")
+        handles = self.send_session_command("DELETE", "window")
+        if len(handles) == 0:
+            # With no more open top-level browsing contexts, the session is closed.
+            self.session_id = None
+
+        return handles
 
     @property
     @command
     def handles(self):
         return self.send_session_command("GET", "window/handles")
 
     @property
     @command