diff --git a/infrastructure/testdriver/set_permission.html b/infrastructure/testdriver/set_permission.https.html similarity index 71% rename from infrastructure/testdriver/set_permission.html rename to infrastructure/testdriver/set_permission.https.html index 1e92a26398d3215..af743f638289602 100644 --- a/infrastructure/testdriver/set_permission.html +++ b/infrastructure/testdriver/set_permission.https.html @@ -8,10 +8,10 @@ diff --git a/resources/testdriver.js b/resources/testdriver.js index 22d5ead72267a39..f102c8774f7efcb 100644 --- a/resources/testdriver.js +++ b/resources/testdriver.js @@ -216,7 +216,9 @@ * This function simulates a user setting a permission into a particular state as described * in {@link https://w3c.github.io/permissions/#set-permission-command} * - * @param {String} name - the name of the permission + * @param {Object} descriptor - a [PermissionDescriptor]{@link + * https://w3c.github.io/permissions/#dictdef-permissiondescriptor} + * object * @param {String} state - the state of the permission * @param {boolean} one_realm - Optional. Whether the permission applies to only one realm * @@ -226,12 +228,10 @@ * @returns {Promise} fulfilled after the permission is set, or rejected if setting the * permission fails */ - set_permission: function(name, state, one_realm) { + set_permission: function(descriptor, state, one_realm) { let permission_params = { - descriptor: { - name: name - }, - state: state, + descriptor, + state, oneRealm: one_realm, }; return window.test_driver_internal.set_permission(permission_params); diff --git a/tools/wptrunner/wptrunner/executors/base.py b/tools/wptrunner/wptrunner/executors/base.py index 5e55f33ee1f5f40..a1ce92a00252353 100644 --- a/tools/wptrunner/wptrunner/executors/base.py +++ b/tools/wptrunner/wptrunner/executors/base.py @@ -782,7 +782,7 @@ def __call__(self, payload): state = permission_params["state"] one_realm = permission_params.get("oneRealm", False) self.logger.debug("Setting permission %s to %s, oneRealm=%s" % (name, state, one_realm)) - self.protocol.set_permission.set_permission(name, state, one_realm) + self.protocol.set_permission.set_permission(descriptor, state, one_realm) class AddVirtualAuthenticatorAction(object): def __init__(self, logger, protocol): diff --git a/tools/wptrunner/wptrunner/executors/executorwebdriver.py b/tools/wptrunner/wptrunner/executors/executorwebdriver.py index 8ea59b2577d0825..221f48a3ea9cb8c 100644 --- a/tools/wptrunner/wptrunner/executors/executorwebdriver.py +++ b/tools/wptrunner/wptrunner/executors/executorwebdriver.py @@ -208,11 +208,9 @@ class WebDriverSetPermissionProtocolPart(SetPermissionProtocolPart): def setup(self): self.webdriver = self.parent.webdriver - def set_permission(self, name, state, one_realm): + def set_permission(self, descriptor, state, one_realm): permission_params_dict = { - "descriptor": { - "name": name - }, + "descriptor": descriptor, "state": state, } if one_realm is not None: diff --git a/tools/wptrunner/wptrunner/executors/protocol.py b/tools/wptrunner/wptrunner/executors/protocol.py index 1a47fa9f1d8cc46..a1e8dacecb695af 100644 --- a/tools/wptrunner/wptrunner/executors/protocol.py +++ b/tools/wptrunner/wptrunner/executors/protocol.py @@ -312,10 +312,10 @@ class SetPermissionProtocolPart(ProtocolPart): name = "set_permission" @abstractmethod - def set_permission(self, name, state, one_realm=False): + def set_permission(self, descriptor, state, one_realm=False): """Set permission state. - :param name: The name of the permission to set. + :param descriptor: A PermissionDescriptor object. :param state: The state to set the permission to. :param one_realm: Whether to set the permission for only one realm.""" pass