Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!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>