blob: c37d78361b7e490a2fb8895d0e22ffc256e137a7 [file] [log] [blame]
<!doctype html><!-- webkit-test-runner [ useServiceWorkerShortTimeout=true ] -->
<html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/routines.js"></script>
</head>
<body>
<script>
promise_test(async (test) => {
return promise_rejects(test, new TypeError, navigator.serviceWorker.register("service-worker-spinning-worker.js", { scope : "spin-run" }));
}, "Spin at running ");
promise_test(async (test) => {
const registration = await navigator.serviceWorker.register("service-worker-spinning-worker.js", { scope : "spin-install" });
const worker = registration.installing;
await waitForState(registration.installing, "redundant");
}, "Spin in install");
promise_test(async (test) => {
const registration = await navigator.serviceWorker.register("service-worker-spinning-worker.js", { scope : "spin-after-install" });
return waitForServiceWorkerNoLongerRunning(registration.installing);
}, "Spin after install");
</script>
</body>
</html>