Service Worker Fetch events should time out.
[WebKit-https.git] / LayoutTests / http / tests / workers / service / resources / basic-timeout-worker.js
1 self.addEventListener("fetch", (event) => {
2     if (event.request.url.indexOf("timeout") !== -1) {
3         while (1) { }
4     } else
5         event.respondWith(new Response(null, { status: 200, statusText: "Hello from service worker", headers: [["Source", "ServiceWorker"]] }));
6 });