Bug 1381858 - Ensure we have a valid window handle before trying to wait, r=ato
authorJames Graham <james@hoppipolla.co.uk>
Thu, 29 Jun 2017 09:29:44 -0700
changeset 418677 c3df1a01c190a85543f1fef04878ecef967857c5
parent 418676 a3f0953e4966f037237b45300d531ff7fd9e35fc
child 418678 87fa6c58f76306de9143991a69fd6d65859af02c
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1381858
milestone56.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 1381858 - Ensure we have a valid window handle before trying to wait, r=ato If we switched to a window that is now closed (possible in a reftest run, for example), we might end up calling execute_async_script without a valid current window. The runner window is always supposed to be open (and if it isn't then waiting won't make much sense anyway), so switch to that before executing script in wait(). MozReview-Commit-ID: ERoN4sz5SuH
testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py
@@ -171,16 +171,17 @@ class MarionetteProtocol(Protocol):
         if runner_handle != self.runner_handle:
             self.load_runner(protocol)
 
     def wait(self):
         socket_timeout = self.marionette.client.sock.gettimeout()
         if socket_timeout:
             self.marionette.timeout.script = socket_timeout / 2
 
+        self.marionette.switch_to_window(self.runner_handle)
         while True:
             try:
                 self.marionette.execute_async_script("")
             except errors.ScriptTimeoutException:
                 self.logger.debug("Script timed out")
                 pass
             except (socket.timeout, IOError):
                 self.logger.debug("Socket closed")