| <html> |
| <head> |
| <script src="resources/sw-test-pre.js"></script> |
| </head> |
| <body> |
| <script> |
| navigator.serviceWorker.addEventListener("message", function(event) { |
| if (event.data) |
| log("PASS: service worker received install event and resolved the extend lifetime promise"); |
| else |
| log("FAIL: service worker did not receive install event or did not resolve the extend lifetime promise"); |
| |
| finishSWTest(); |
| }); |
| |
| navigator.serviceWorker.register("resources/basic-install-event-waitUntil-resolve-worker.js", { }).then(function(registration) { |
| waitForState(registration.installing, "installed").then(function() { |
| registration.waiting.postMessage("CheckResolvedExtendLifetimePromise"); |
| }); |
| }, function() { |
| log("FAIL: Failed to register the service worker"); |
| finishSWTest(); |
| }); |
| </script> |
| </body> |
| </html> |