diff --git a/testing/web-platform/harness/wptrunner/executors/executormarionette.py b/testing/web-platform/harness/wptrunner/executors/executormarionette.py index 663f95f7ee4..1d03ef6d1ec 100644 --- a/testing/web-platform/harness/wptrunner/executors/executormarionette.py +++ b/testing/web-platform/harness/wptrunner/executors/executormarionette.py @@ -30,10 +30,12 @@ required_files = [("testharness_runner.html", "", False), def do_delayed_imports(): global marionette + global errors try: import marionette + from marionette import errors except ImportError: - import marionette_driver.marionette as marionette + from marionette_driver import marionette, errors class MarionetteTestExecutor(TestExecutor): @@ -153,13 +155,13 @@ class MarionetteTestExecutor(TestExecutor): try: self.marionette.set_script_timeout((timeout + extra_timeout) * 1000) - except IOError, marionette.errors.InvalidResponseException: + except IOError, errors.InvalidResponseException: self.logger.error("Lost marionette connection before starting test") return Stop try: result = self.convert_result(test, self.do_test(test, timeout)) - except marionette.errors.ScriptTimeoutException: + except errors.ScriptTimeoutException: with result_lock: if not result_flag.is_set(): result_flag.set() @@ -179,7 +181,7 @@ class MarionetteTestExecutor(TestExecutor): # else: # break # Now need to check if the browser is still responsive and restart it if not - except (socket.timeout, marionette.errors.InvalidResponseException, IOError): + except (socket.timeout, errors.InvalidResponseException, IOError): # This can happen on a crash # Also, should check after the test if the firefox process is still running # and otherwise ignore any other result and set it to crash @@ -250,7 +252,7 @@ class MarionetteReftestExecutor(MarionetteTestExecutor): full_url = urlparse.urljoin(self.http_server_url, url) try: self.marionette.navigate(full_url) - except marionette.errors.MarionetteException: + except errors.MarionetteException: return {"status": "ERROR", "message": "Failed to load url %s" % (full_url,)} if url_type == "test": diff --git a/testing/web-platform/harness/wptrunner/update/tree.py b/testing/web-platform/harness/wptrunner/update/tree.py index 7b01e30288d..292a45a4fe2 100644 --- a/testing/web-platform/harness/wptrunner/update/tree.py +++ b/testing/web-platform/harness/wptrunner/update/tree.py @@ -124,6 +124,13 @@ class HgTree(object): def commit_patch(self): self.hg("qfinish") + def contains_commit(self, commit): + try: + self.hg("identify", "-r", commit.sha1) + return True + except subprocess.CalledProcessError: + return False + class GitTree(object): name = "git"