diff --git a/testing/marionette/client/marionette/marionette.py b/testing/marionette/client/marionette/marionette.py index d9b36990452..d845861ebb9 100644 --- a/testing/marionette/client/marionette/marionette.py +++ b/testing/marionette/client/marionette/marionette.py @@ -247,7 +247,8 @@ class Marionette(object): self.client.close() return response - def get_session_capabilities(self): + @property + def session_capabilities(self): response = self._send_message('getSessionCapabilities', 'value') return response diff --git a/testing/marionette/client/marionette/tests/unit/test_capabilities.py b/testing/marionette/client/marionette/tests/unit/test_capabilities.py new file mode 100644 index 00000000000..0590cc76142 --- /dev/null +++ b/testing/marionette/client/marionette/tests/unit/test_capabilities.py @@ -0,0 +1,12 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +from marionette_test import MarionetteTestCase + +class TestCapabilities(MarionetteTestCase): + + def testThatWeCanGetTheCapabilities(self): + capabilities = self.marionette.session_capabilities + self.assertTrue(capabilities.has_key('takesScreenshot')) + diff --git a/testing/marionette/marionette-actors.js b/testing/marionette/marionette-actors.js index 1f48ddfae32..823de275854 100644 --- a/testing/marionette/marionette-actors.js +++ b/testing/marionette/marionette-actors.js @@ -374,6 +374,26 @@ MarionetteDriverActor.prototype = { } }, + getSessionCapabilities: function MDA_getSessionCapabilities(){ + let rotatable = appName == "B2G" ? true : false; + + let value = { + 'appBuildId' : Services.appinfo.appBuildID, + 'XULappId' : Services.appinfo.ID, + 'cssSelectorsEnabled': true, + 'browserName': appName, + 'handlesAlerts': false, + 'javascriptEnabled': true, + 'nativeEvents': false, + 'platform': Services.appinfo.OS, + 'rotatable': rotatable, + 'takesScreenshot': false, + 'version': Services.appinfo.version + }; + + this.sendResponse(value); + }, + /** * Log message. Accepts user defined log-level. * @@ -1443,6 +1463,7 @@ MarionetteDriverActor.prototype = { MarionetteDriverActor.prototype.requestTypes = { "newSession": MarionetteDriverActor.prototype.newSession, + "getSessionCapabilities": MarionetteDriverActor.prototype.getSessionCapabilities, "log": MarionetteDriverActor.prototype.log, "getLogs": MarionetteDriverActor.prototype.getLogs, "addPerfData": MarionetteDriverActor.prototype.addPerfData,