summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/service-workers/service-worker/navigation-preload/navigationPreload.https.html
blob: 392e5c14dc8c7ca7d40df4396a102f379e1d55ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!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>