PSA: Custom Handlers testing automation in ChromeDriver

48 views
Skip to first unread message

Javier Fernandez

unread,
Sep 6, 2022, 12:00:17 PM9/6/22
to blink-dev
Contact emails
jfern...@igalia.com

Specification
https://html.spec.whatwg.org/multipage/system-state.html#custom-handlers

Summary
The proposed `setRPHRegistrationMode` WebDriver extension command places the user agent in a mode where it will automatically accept or reject (depending on the mode) future Custom Protocol Handlers registrations. This allows full end-to-end testing of Custom Handlers API (eg, registerProtocolHandler), which normally requires user interaction to confirm the user's consent to the protocol registration.

I'm planning to implement and ship this testing feature, if there are no objections.

There is an WIP PR that is still under consideration, and pending of positive signals, or lack of objections, from implementors.
See https://github.com/whatwg/html/pull/8267 for more details.

Motivation
The HTML spec states in the Custom Handler section that user agents may launch a prompt dialog during the registration of a custom protocol handler:

A user agent could, for instance, prompt the user and offer the user the opportunity to add the site to a shortlist of handlers, or make the handlers their default, or cancel the request. User agents could also silently collect the information, providing it only when relevant to the user.

Currently, there are only manual tests for the registerProtocolHandler method:

https://github.com/web-platform-tests/wpt/blob/master/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol-handler-fragment-nosw-manual.https.html

The main problem is that Chrome, and also Firefox, launch a prompt dialog to ask the user for confirmation to register the protocol handler.

We could provide testing automation if we had a WebDriver extension command that would autogrant or autoreject the registration request.

Tracking bug
https://bugs.chromium.org/p/chromium/issues/detail?id=1359103

Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/5153153574502400

Mathias Bynens

unread,
Sep 8, 2022, 4:09:44 AM9/8/22
to Javier Fernandez, blink-dev, Vladimir Nechaev
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/1ab06321-ce64-ccb5-08fb-05e42a38ebde%40igalia.com.
Reply all
Reply to author
Forward
0 new messages