From 1ee86952156141be7e7776fbe3d25b916c2ad7ce Mon Sep 17 00:00:00 2001 From: Julian Descottes Date: Wed, 2 Jun 2021 14:30:23 +0000 Subject: [PATCH] Bug 1713775 - [marionette] Fail session creation if the webSocketUrl capability is passed r=remote-protocol-reviewers,marionette-reviewers,jgraham Until a BiDi implementation can be successfully started, creating a session with the webSocketUrl capability should throw. Differential Revision: https://phabricator.services.mozilla.com/D116590 --- remote/marionette/session.js | 5 +++++ remote/marionette/test/xpcshell/test_session.js | 1 + .../marionette_harness/tests/unit/test_capabilities.py | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/remote/marionette/session.js b/remote/marionette/session.js index c2c121298597..4e89f82702b8 100644 --- a/remote/marionette/session.js +++ b/remote/marionette/session.js @@ -650,6 +650,11 @@ class Capabilities extends Map { } break; + case "webSocketUrl": + throw new error.InvalidArgumentError( + "webSocketURL is not supported yet" + ); + case "moz:accessibilityChecks": assert.boolean(v, pprint`Expected ${k} to be boolean, got ${v}`); break; diff --git a/remote/marionette/test/xpcshell/test_session.js b/remote/marionette/test/xpcshell/test_session.js index 48b8bbb97804..6a43c05ee2a7 100644 --- a/remote/marionette/test/xpcshell/test_session.js +++ b/remote/marionette/test/xpcshell/test_session.js @@ -614,6 +614,7 @@ add_test(function test_Capabilities_fromJSON() { () => fromJSON({ "moz:webdriverClick": 1 }), /InvalidArgumentError/ ); + Assert.throws(() => fromJSON({ webSocketUrl: true }), /InvalidArgumentError/); run_next_test(); }); diff --git a/testing/marionette/harness/marionette_harness/tests/unit/test_capabilities.py b/testing/marionette/harness/marionette_harness/tests/unit/test_capabilities.py index 660e07a45ff8..a79cc5b86827 100644 --- a/testing/marionette/harness/marionette_harness/tests/unit/test_capabilities.py +++ b/testing/marionette/harness/marionette_harness/tests/unit/test_capabilities.py @@ -249,3 +249,9 @@ class TestCapabilityMatching(MarionetteTestCase): SessionNotCreatedException, "InvalidArgumentError" ): self.marionette.start_session({"unhandledPromptBehavior": behavior}) + + def test_web_socket_url(self): + with self.assertRaisesRegexp( + SessionNotCreatedException, "InvalidArgumentError" + ): + self.marionette.start_session({"webSocketUrl": True})