Bug 1771455 [wpt PR 34230] - Prerender: Notification API no longer cancels prerender...
commitbdd9a550b9d32200a5e09bbed5497b103dd273b5
authorLingqi Chi <lingqi@chromium.org>
Thu, 9 Jun 2022 16:22:53 +0000 (9 16:22 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Fri, 10 Jun 2022 03:33:24 +0000 (10 03:33 +0000)
tree2af5314d9d9b5ac20dcc2b981de202a3280167e0
parent387ce89502d82080c7a0d13a9b6c0dc564b1a94b
Bug 1771455 [wpt PR 34230] - Prerender: Notification API no longer cancels prerender, a=testonly

Automatic update from web-platform-tests
Prerender: Notification API no longer cancels prerender

Previously, Notification API's behavior varied from the specification.
https://wicg.github.io/nav-speculation/prerendering.html#patch-notifications

This CL partially fixes this problem, by making notification API return
"default" during prerendering, and defer the corresponding Mojo
interface.
The remaining issue is that the Notification ctor is not deferred yet.
After this CL, the new workflow be like:
1. Web developers call Notification.permission => we return "default" in
the prerendering pages. [Without asking the browser process for the
permission status, as renderer can always return "default" in this case.
So no IPC would be made.
2. Finding Notification.permission returning "default", web pages have
to request permission before making notification.
3. They have to call Notification. requestPermission => this API is
deferred until prerender activation.
4. After prerendering activation, Notification.requestPermission
returns "real value" based on users' decisions. And then, developers
would call Notification() to display notifications.

Tests are updated as well.

Bug: 1280155
Change-Id: Ide70ac5d8a6bb017ba0bb8747a745fcb07145b3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3672395
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Lingqi Chi <lingqi@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1011325}

--

wpt-commits: 7e9df8dcf9218d3ed856aec6fc154b463c7666d1
wpt-pr: 34230
testing/web-platform/tests/speculation-rules/prerender/resources/notification-before-activation.html [new file with mode: 0644]
testing/web-platform/tests/speculation-rules/prerender/resources/notification-on-activation.html [moved from testing/web-platform/tests/speculation-rules/prerender/resources/notification.html with 100% similarity]
testing/web-platform/tests/speculation-rules/prerender/restriction-notification.https.html