Bug 1316622 - Move wptrunner to new Marionette timeouts API; r=jgraham
authorAndreas Tolfsen <ato@mozilla.com>
Thu, 10 Nov 2016 21:05:28 +0000
changeset 323987 27bf0458f5cf02b3adbb66f5e149225de7fc7390
parent 323986 509ad050bea4d5758c60e4c88540738dbca3e243
child 323988 dcf546e59c971b90e187ee043eb48b739756f332
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +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
@@ -119,20 +119,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
@@ -167,17 +169,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
@@ -130,17 +130,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