Bug 1373444 - Look for NoSuchWindowException when waiting for manual browser close in wpt, r=maja_zf draft
authorJames Graham <james@hoppipolla.co.uk>
Thu, 31 Aug 2017 16:12:26 +0100
changeset 656684 7b4a2d0dce12840ad282baadc83bb26ea4eeb23a
parent 656683 6007d13fbaffd2b32e013362e2be87ddc9e6d658
child 729209 78aa9fb7bffef27ef0315f323b969d2b09820db5
push id77287
push userbmo:james@hoppipolla.co.uk
push dateThu, 31 Aug 2017 15:12:54 +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 much 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)