Skip to content

Commit

Permalink
Merge pull request #75 from AutomatedTester/marionette_errors_import
Browse files Browse the repository at this point in the history
Update marionette imports for errors to handle to new marionette package
  • Loading branch information
jgraham committed Feb 20, 2015
2 parents a026aa8 + b7bb88a commit c70189b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions wptrunner/executors/executormarionette.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@

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):
Expand Down Expand Up @@ -153,13 +155,13 @@ def timeout_func():

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()
Expand All @@ -179,7 +181,7 @@ def timeout_func():
# 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
Expand Down Expand Up @@ -250,7 +252,7 @@ def do_test(self, test, timeout):
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":
Expand Down

0 comments on commit c70189b

Please sign in to comment.