Skip to content

Commit

Permalink
Prerender: Upstream Push API test to WPT
Browse files Browse the repository at this point in the history
https://wicg.github.io/nav-speculation/prerendering.html#push-patch

Bug: 1253158
Change-Id: I3d2600976998b75df14f157816bf77185228f25b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3855455
Reviewed-by: Lingqi Chi <lingqi@chromium.org>
Commit-Queue: Antia Puentes <apuentes@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1039681}
  • Loading branch information
antiapuentes authored and Chromium LUCI CQ committed Aug 26, 2022
1 parent 8b43638 commit 1cd3c5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<!DOCTYPE html>
<!--
This file cannot be upstreamed to WPT until:
* internals.setPermission() usage is replaced with a WebDriver API
-->
<title>Access to the Push API is deferred</title>
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/common/utils.js"></script>
<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script>
<script src="/speculation-rules/prerender/resources/utils.js"></script>
<body>
<script>

setup(() => assertSpeculationRulesIsSupported());

promise_test(async t => {
const uid = token();
const bc = new PrerenderChannel('test-channel', uid);
Expand All @@ -30,8 +30,8 @@
// pushManager.subscribe() waits until the permission is granted, which
// is deferred during prerendering so the test would trivially pass without
// the permission.
await internals.setPermission({name: 'push', userVisibleOnly: true},
'granted', location.origin, location.origin);
await test_driver.set_permission({ name: 'push', userVisibleOnly: true },
'granted');

// Install the service worker first to test pushManager.subscribe in the
// prerendering page.
Expand Down

0 comments on commit 1cd3c5c

Please sign in to comment.