From 68bd420c2e6548a3f5d6558e397d087cad67414f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Fern=C3=A1ndez=20Garc=C3=ADa-Boente?= Date: Wed, 11 May 2022 07:45:38 -0700 Subject: [PATCH] New 'protocol-handler' PermissionDescriptor for the setPermission API The idea of this CL is to define a new mapping between blinks's PermissionType enum and the PermissionDescriptor structure defined in by the Permission [1] interface. The new mapping will be useful to provide permission automation for the testing of the CustomHandler HTML API [2]. There is an ongoing discussion with the WPT community in the issue #26819 [3], where it seems to be enough agreement on the idea of using the WebDriver setPermission API to grant or deny permission for the registerProtocolHandler method, avoiding the user interaction. This CL tries to cover all the end points of the Permission interface, either the InternalPermission class or through the CRDTP. [1] https://w3c.github.io/permissions/#permissions-interface [2] https://html.spec.whatwg.org/multipage/system-state.html#custom-handlers [3] https://github.com/web-platform-tests/wpt/issues/26819 Bug: 1321073 Change-Id: I289bc89bd1be31b18fd91ed3d81c6dd5fe853a0c --- infrastructure/testdriver/set_permission.https.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/infrastructure/testdriver/set_permission.https.html b/infrastructure/testdriver/set_permission.https.html index af743f63828960..df860bce524834 100644 --- a/infrastructure/testdriver/set_permission.https.html +++ b/infrastructure/testdriver/set_permission.https.html @@ -14,4 +14,8 @@ promise_test(t => { return test_driver.set_permission({name: "push", userVisibleOnly: true}, "denied"); }, "Deny Permission, omit one realm"); + +promise_test(t => { + return test_driver.set_permission({name: "protocol-handler"}, "granted", true); +}, "Grant Permission for 'protocol-handler' operations");