blob: e0d64d2b666910b3381c979ce132f77f449d5946 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="resources/sw-test-pre.js"></script>
<script>
log("* ServiceWorkerGlobalScope properties");
const expectedProperties = [
"Blob", "Cache", "CacheStorage", "Client", "Clients", "ExtendableEvent", "ExtendableMessageEvent",
"FetchEvent", "Headers", "MessageChannel", "MessageEvent", "MessagePort", "Request", "Response",
"ServiceWorkerGlobalScope", "WebSocket", "WindowClient", "WorkerGlobalScope"];
let receivedMessages = 0;
navigator.serviceWorker.addEventListener("message", function(event) {
log(event.data);
receivedMessages++;
if (receivedMessages == expectedProperties.length)
finishSWTest();
});
navigator.serviceWorker.register("resources/ServiceWorkerGlobalScope-properties-worker.js", { }).then(function(registration) {
for (let property of expectedProperties)
registration.installing.postMessage("Object.getOwnPropertyDescriptor(self, '" + property + "')");
});
</script>
</body>
</html>