blob: 392e5c14dc8c7ca7d40df4396a102f379e1d55ad [file] [log] [blame]
<!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>