Bug 1316622 - Move wptrunner to new Marionette timeouts API; r?jgraham draft
authorAndreas Tolfsen <ato@mozilla.com>
Thu, 10 Nov 2016 21:05:28 +0000
changeset 440377 24120fa7d98500c232f14603570e6c78e6a47df8
parent 440376 419bd19691f601abd39373b3886a9fb5a2897521
child 440378 19a79c40bb0541917103ed8deb44d2c57bb64b04
push id36214
push userbmo:ato@mozilla.com
push dateThu, 17 Nov 2016 13:46:37 +0000
reviewersjgraham
bugs1316622
milestone53.0a1
Bug 1316622 - Move wptrunner to new Marionette timeouts API; r?jgraham MozReview-Commit-ID: 2ZnodSJ8L4S
testing/web-platform/harness/wptrunner/executors/executormarionette.py
testing/web-platform/harness/wptrunner/executors/executorselenium.py
--- a/testing/web-platform/harness/wptrunner/executors/executormarionette.py
+++ b/testing/web-platform/harness/wptrunner/executors/executormarionette.py
@@ -121,20 +121,22 @@ class MarionetteProtocol(Protocol):
         except Exception:
             return False
         return True
 
     def after_connect(self):
         self.load_runner("http")
 
     def set_timeout(self, timeout):
-        """Set the marionette script timeout
+        """Set the Marionette script timeout.
 
-        :param timeout: Script timeout in seconds"""
-        self.marionette.set_script_timeout(timeout * 1000)
+        :param timeout: Script timeout in seconds
+
+        """
+        self.marionette.timeout.script = timeout
         self.timeout = timeout
 
     def load_runner(self, protocol):
         # Check if we previously had a test window open, and if we did make sure it's closed
         self.marionette.execute_script("if (window.wrappedJSObject.win) {window.wrappedJSObject.win.close()}")
         url = urlparse.urljoin(self.executor.server_url(protocol), "/testharness_runner.html")
         self.logger.debug("Loading %s" % url)
         self.runner_handle = self.marionette.current_window_handle
@@ -169,17 +171,17 @@ class MarionetteProtocol(Protocol):
 
         self.marionette.switch_to_window(runner_handle)
         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.set_script_timeout((socket_timeout / 2) * 1000)
+            self.marionette.timeout.script = socket_timeout / 2
 
         while True:
             try:
                 self.marionette.execute_async_script("")
             except errors.ScriptTimeoutException:
                 self.logger.debug("Script timed out")
                 pass
             except (socket.timeout, IOError):
--- a/testing/web-platform/harness/wptrunner/executors/executorselenium.py
+++ b/testing/web-platform/harness/wptrunner/executors/executorselenium.py
@@ -128,17 +128,17 @@ class SeleniumRun(object):
         self.result_flag = threading.Event()
 
     def run(self):
         timeout = self.timeout
 
         try:
             self.webdriver.set_script_timeout((timeout + extra_timeout) * 1000)
         except exceptions.ErrorInResponseException:
-            self.logger.error("Lost webdriver connection")
+            self.logger.error("Lost WebDriver connection")
             return Stop
 
         executor = threading.Thread(target=self._run)
         executor.start()
 
         flag = self.result_flag.wait(timeout + 2 * extra_timeout)
         if self.result is None:
             assert not flag