Bug 1322277 - Fix usage of capabilities in start_session. r=ato, a=test-only
authorHenrik Skupin <mail@hskupin.info>
Mon, 23 Jan 2017 20:35:15 +0100
changeset 366672 6f4c97200bb7f20bf2706bef9a5b6281ce01e2e5
parent 366669 3c59e804284b06302c10645d5057624f41540e9d
child 366673 96e2a1ec523dd8b4f364a4c01ff1e087d3bafd71
push id6830
push userryanvm@gmail.com
push dateThu, 26 Jan 2017 21:49:19 +0000
treeherdermozilla-beta@65a200a44636 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato, test-only
Bug 1322277 - Fix usage of capabilities in start_session. r=ato, a=test-only Capabilities as passed into start_session() can be desiredCapabilities and requiredCapabilities. As such the parameter name should be clear. MozReview-Commit-ID: GPNv4g9HMO2
--- 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)
-    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):
         # Call wait_for_port() before attempting to connect in
         # the event gecko hasn't started yet.
         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")