Backed out 3 changesets (bug 1402892) for wpt failures in /fetch/api/request/request...
[gecko.git] / testing / web-platform / tests / fetch / api / request / destination / resources / fetch-destination-worker-no-load-event.js
blobfd71ffb2182fb4525f0cf6e1371790964aecbfad
1 self.addEventListener('fetch', function(event) {
2     if (event.request.url.includes('dummy')) {
3         event.waitUntil(async function() {
4             let destination = new URL(event.request.url).searchParams.get("dest");
5             let client = await self.clients.get(event.clientId);
6             if (event.request.destination == destination) {
7                 client.postMessage("PASS");
8             } else {
9                 client.postMessage("FAIL");
10             }
11         }())
12     }
13     event.respondWith(fetch(event.request));
14 });