Layout Test http/tests/workers/service/postmessage-after-sw-process-crash.https.html...
[WebKit-https.git] / LayoutTests / http / tests / workers / service / resources / postmessage-after-sw-process-crash-worker.js
1 var client = null;
2 let receivedState = false;
3
4 self.addEventListener("message", (event) => {
5     if (event.data === "SetState") {
6         receivedState = true;
7         return;
8     }
9
10     if (event.data === "HasState") {
11         event.source.postMessage(receivedState);
12         return;
13     }
14 });
15