<!DOCTYPE html>
<html>
<body>
<script src="resources/sw-test-pre.js"></script>
<script>
log("* Tests that serviceWorker.register() inside service workers");
log("");

navigator.serviceWorker.addEventListener("message", function(event) {
    if (event.data === "DONE") {
        finishSWTest();
        return;
    }
    log(event.data);
});

navigator.serviceWorker.register("resources/ServiceWorkerGlobalScope_register-worker.js", { }).then(function(registration) {
    registration.installing.postMessage("runTest");
});
</script>
</body>
</html>
