Bug 1283216 - Fix by allowing the marionette client object to be constructed with the build from the local environment as default. r?ato
MozReview-Commit-ID: 77jewG68SAW
***
Bug 1283216 - Fix by allowing the marionette client object to be constructed with the build from the local environment as default. r?ato
MozReview-Commit-ID: 1j4teWjIFgd
--- a/testing/marionette/client/marionette_driver/marionette.py
+++ b/testing/marionette/client/marionette_driver/marionette.py
@@ -17,16 +17,24 @@ from contextlib import contextmanager
import errors
import transport
from .decorators import do_process_check
from .geckoinstance import GeckoInstance
from .keys import Keys
from .timeout import Timeouts
+try:
+ from mozbuild.base import (
+ MozbuildObject
+ )
+ build = MozbuildObject.from_environment()
+except ImportError:
+ build = None
+
WEBELEMENT_KEY = "ELEMENT"
W3C_WEBELEMENT_KEY = "element-6066-11e4-a52e-4f735466cecf"
class HTMLElement(object):
"""Represents a DOM Element."""
def __init__(self, marionette, id):
@@ -575,17 +583,20 @@ class Marionette(object):
`app`.
:param app: Type of ``instance_class`` to use for managing app
instance. See ``marionette_driver.geckoinstance``.
:param instance_args: Arguments to pass to ``instance_class``.
"""
self.host = host
self.port = self.local_port = int(port)
- self.bin = bin
+ if bin is None and build is not None:
+ self.bin = build.get_binary_path()
+ else:
+ self.bin = bin
self.client = None
self.instance = None
self.session = None
self.session_id = None
self.process_id = None
self.profile = None
self.window = None
self.chrome_window = None