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
--- 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)