Bug 1373444 - Look for NoSuchWindowException when waiting for manual browser close in wpt, r=maja_zf
authorJames Graham <james@hoppipolla.co.uk>
Thu, 31 Aug 2017 16:12:26 +0100
changeset 659198 ec49322e332fc2893e54f9fbd2c55a160e621875
parent 659197 00f0c51097671dd0716e753fef2f55c256299539
child 659199 8b984dd3cda3c236e3085791499cbeeae92cad08
push id78047
push userbmo:francesco.lodolo@gmail.com
push dateTue, 05 Sep 2017 17:25:17 +0000
reviewersmaja_zf
bugs1373444
milestone57.0a1
Bug 1373444 - Look for NoSuchWindowException when waiting for manual browser close in wpt, r=maja_zf This method works by running a long-running script and catching the exception when it is interrupted. But the exception changed so we must make a corresponding change here. MozReview-Commit-ID: EdZZAOVZ0Sw
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
@@ -175,24 +175,27 @@ class MarionetteProtocol(Protocol):
         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.NoSuchWindowException:
+                # The window closed
+                break
             except errors.ScriptTimeoutException:
                 self.logger.debug("Script timed out")
                 pass
             except (socket.timeout, IOError):
                 self.logger.debug("Socket closed")
                 break
             except Exception as e:
-                self.logger.error(traceback.format_exc(e))
+                self.logger.warning(traceback.format_exc(e))
                 break
 
     def on_environment_change(self, old_environment, new_environment):
         #Unset all the old prefs
         for name in old_environment.get("prefs", {}).iterkeys():
             value = self.executor.original_pref_values[name]
             if value is None:
                 self.clear_user_pref(name)