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
This commit is contained in:
Julian Descottes 2021-06-02 14:30:23 +00:00
Родитель d90d1a148c
Коммит 1ee8695215
3 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -650,6 +650,11 @@ class Capabilities extends Map {
} }
break; break;
case "webSocketUrl":
throw new error.InvalidArgumentError(
"webSocketURL is not supported yet"
);
case "moz:accessibilityChecks": case "moz:accessibilityChecks":
assert.boolean(v, pprint`Expected ${k} to be boolean, got ${v}`); assert.boolean(v, pprint`Expected ${k} to be boolean, got ${v}`);
break; break;

Просмотреть файл

@ -614,6 +614,7 @@ add_test(function test_Capabilities_fromJSON() {
() => fromJSON({ "moz:webdriverClick": 1 }), () => fromJSON({ "moz:webdriverClick": 1 }),
/InvalidArgumentError/ /InvalidArgumentError/
); );
Assert.throws(() => fromJSON({ webSocketUrl: true }), /InvalidArgumentError/);
run_next_test(); run_next_test();
}); });

Просмотреть файл

@ -249,3 +249,9 @@ class TestCapabilityMatching(MarionetteTestCase):
SessionNotCreatedException, "InvalidArgumentError" SessionNotCreatedException, "InvalidArgumentError"
): ):
self.marionette.start_session({"unhandledPromptBehavior": behavior}) self.marionette.start_session({"unhandledPromptBehavior": behavior})
def test_web_socket_url(self):
with self.assertRaisesRegexp(
SessionNotCreatedException, "InvalidArgumentError"
):
self.marionette.start_session({"webSocketUrl": True})