Support container.register() / registration.unregister() / inside service workers
[WebKit-https.git] / LayoutTests / http / tests / workers / service / ServiceWorkerGlobalScope_register.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="resources/sw-test-pre.js"></script>
5 <script>
6 log("* Tests that serviceWorker.register() inside service workers");
7 log("");
8
9 navigator.serviceWorker.addEventListener("message", function(event) {
10     if (event.data === "DONE") {
11         finishSWTest();
12         return;
13     }
14     log(event.data);
15 });
16
17 navigator.serviceWorker.register("resources/ServiceWorkerGlobalScope_register-worker.js", { }).then(function(registration) {
18     registration.installing.postMessage("runTest");
19 });
20 </script>
21 </body>
22 </html>