FormDataElement::lengthInBytes should use ThreadableBlobRegistry
[WebKit-https.git] / LayoutTests / http / tests / workers / service / resources / service-worker-cache-api-worker.js
index e69b74a..1c47a48 100644 (file)
@@ -18,11 +18,20 @@ function statusResponse()
     return new Response(null, {status: 200, statusText: status});
 }
 
-self.addEventListener("fetch", (event) => {
+self.addEventListener("fetch", async (event) => {
     if (event.request.url.indexOf("status") !== -1) {
         event.respondWith(promise.then(statusResponse, statusResponse));
         return;
     }
+    if (event.request.url.indexOf("opaqueWithBlob") !== -1) {
+        event.respondWith(self.caches.open("opaque").then((cache) => {
+            let response = self.internals.createOpaqueWithBlobBodyResponse();
+            return cache.put("opaque", response);
+        }).then(() => {
+            return new Response("PASS");
+        }));
+        return;
+    }
     if (!event.request.url.endsWith(".fromserviceworker")) {
         state = "unknown url";
         event.respondWith(new Response(null, {status: 404, statusText: "Not Found"}));