Bug 1322277 - Fix usage of capabilities in start_session. r=ato
authorHenrik Skupin <mail@hskupin.info>
Mon, 06 Feb 2017 13:03:18 +0100
changeset 340914 755e183915530e9bd7b25af25aecd6949a9f162f
parent 340913 6332ef237e2145b7647d48cb90e39b27aed58a85
child 340915 9908b674ae2c30814cefdbd0f1d6373be1794caa
push id36953
push userhskupin@mozilla.com
push dateMon, 06 Feb 2017 15:40:01 +0000
treeherderautoland@9908b674ae2c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1322277
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1322277 - Fix usage of capabilities in start_session. r=ato Capabilities as passed into start_session() can be desiredCapabilities and requiredCapabilities. As such the parameter name should be clear. MozReview-Commit-ID: GPNv4g9HMO2
testing/marionette/client/marionette_driver/marionette.py
--- a/testing/marionette/client/marionette_driver/marionette.py
+++ b/testing/marionette/client/marionette_driver/marionette.py
@@ -1242,23 +1242,22 @@ class Marionette(object):
         '''
         Returns an absolute url for files served from Marionette's www directory.
 
         :param relative_url: The url of a static file, relative to Marionette's www directory.
         '''
         return "{0}{1}".format(self.baseurl, relative_url)
 
     @do_process_check
-    def start_session(self, desired_capabilities=None, session_id=None, timeout=60):
+    def start_session(self, capabilities=None, session_id=None, timeout=60):
         """Create a new Marionette session.
 
         This method must be called before performing any other action.
 
-        :param desired_capabilities: An optional dict of desired
-            capabilities.  This is currently ignored.
+        :param capabilities: An optional dict of desired or required capabilities.
         :param timeout: Timeout in seconds for the server to be ready.
         :param session_id: unique identifier for the session. If no session id is
             passed in then one will be generated by the marionette server.
 
         :returns: A dict of the capabilities offered.
 
         """
         self.crashed = 0
@@ -1274,17 +1273,17 @@ class Marionette(object):
             self.port,
             self.socket_timeout)
 
         # Call wait_for_port() before attempting to connect in
         # the event gecko hasn't started yet.
         self.wait_for_port(timeout=timeout)
         self.protocol, _ = self.client.connect()
 
-        body = {"capabilities": desired_capabilities, "sessionId": session_id}
+        body = {"capabilities": capabilities, "sessionId": session_id}
         resp = self._send_message("newSession", body)
 
         self.session_id = resp["sessionId"]
         self.session = resp["value"] if self.protocol == 1 else resp["capabilities"]
         # fallback to processId can be removed in Firefox 55
         self.process_id = self.session.get("moz:processID", self.session.get("processId"))
         self.profile = self.session.get("moz:profile")