Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /service-workers/service-worker/navigation-preload/navigationPreload.https.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>ServiceWorker: navigator.serviceWorker.navigationPreload</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/test-helpers.sub.js"></script>
<script src="resources/helpers.js"></script>
<script>
promise_test(async t => {
const SCRIPT = '../resources/empty-worker.js';
const SCOPE = '../resources/navigationpreload';
const registration =
await service_worker_unregister_and_register(t, SCRIPT, SCOPE);
const navigationPreload = registration.navigationPreload;
assert_true(navigationPreload instanceof NavigationPreloadManager,
'ServiceWorkerRegistration.navigationPreload');
await registration.unregister();
}, "The navigationPreload attribute must return service worker " +
"registration's NavigationPreloadManager object.");
</script>