From f8eef42e987116ec7a5ad49c5a9a0dff0056838f Mon Sep 17 00:00:00 2001 From: moz-wptsync-bot Date: Fri, 1 Sep 2023 08:58:04 +0100 Subject: [PATCH] support virtual authenticator functions in webdriver (#41377) Depends on D185198 Differential Revision: https://phabricator.services.mozilla.com/D162624 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1676679 gecko-commit: d918661c17e3b35d0fdc71e621020e4f2fbf51dd gecko-reviewers: webdriver-reviewers, jgraham, whimboo Co-authored-by: Dana Keeler --- .../wptrunner/executors/executormarionette.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tools/wptrunner/wptrunner/executors/executormarionette.py b/tools/wptrunner/wptrunner/executors/executormarionette.py index 95f186082042e3..a3b56fe08df11e 100644 --- a/tools/wptrunner/wptrunner/executors/executormarionette.py +++ b/tools/wptrunner/wptrunner/executors/executormarionette.py @@ -48,10 +48,11 @@ def do_delayed_imports(): - global errors, marionette, Addons + global errors, marionette, Addons, WebAuthn from marionette_driver import marionette, errors from marionette_driver.addons import Addons + from marionette_driver.webauthn import WebAuthn def _switch_to_window(marionette, handle): @@ -590,28 +591,28 @@ def generate_test_report(self, config): class MarionetteVirtualAuthenticatorProtocolPart(VirtualAuthenticatorProtocolPart): def setup(self): - self.marionette = self.parent.marionette + self.webauthn = WebAuthn(self.parent.marionette) def add_virtual_authenticator(self, config): - raise NotImplementedError("add_virtual_authenticator not yet implemented") + return self.webauthn.add_virtual_authenticator(config) def remove_virtual_authenticator(self, authenticator_id): - raise NotImplementedError("remove_virtual_authenticator not yet implemented") + self.webauthn.remove_virtual_authenticator(authenticator_id) def add_credential(self, authenticator_id, credential): - raise NotImplementedError("add_credential not yet implemented") + self.webauthn.add_credential(authenticator_id, credential) def get_credentials(self, authenticator_id): - raise NotImplementedError("get_credentials not yet implemented") + return self.webauthn.get_credentials(authenticator_id) def remove_credential(self, authenticator_id, credential_id): - raise NotImplementedError("remove_credential not yet implemented") + self.webauthn.remove_credential(authenticator_id, credential_id) def remove_all_credentials(self, authenticator_id): - raise NotImplementedError("remove_all_credentials not yet implemented") + self.webauthn.remove_all_credentials(authenticator_id) def set_user_verified(self, authenticator_id, uv): - raise NotImplementedError("set_user_verified not yet implemented") + self.webauthn.set_user_verified(authenticator_id, uv) class MarionetteSetPermissionProtocolPart(SetPermissionProtocolPart):