FormDataElement::lengthInBytes should use ThreadableBlobRegistry
[WebKit-https.git] / LayoutTests / http / tests / workers / service / service-worker-cache-api.https.html
1 <html>
2 <head>
3 <script src="resources/sw-test-pre.js"></script>
4 <script src="/resources/testharness.js"></script>
5 <script src="/resources/testharnessreport.js"></script>
6 </head>
7 <body>
8 <script>
9 var frame;
10 promise_test(async (test) => {
11     frame = await interceptedFrame("resources/service-worker-cache-api-worker.js", "/workers/service/resources/");
12     var fetch = frame.contentWindow.fetch;
13
14     var response = await fetch("/resources/square100.png.fromserviceworker");
15     var buffer =  await response.arrayBuffer();
16     assert_equals(buffer.byteLength, 12940);
17 }, "Testing cache API in service worker");
18
19 promise_test(async (test) => {
20     if (!self.internals)
21         return Promise.reject("internals required for this test");
22
23     var response = await frame.contentWindow.fetch("opaqueWithBlob");
24     assert_equals(await response.text(), "PASS");
25 }, "Testing cache API with opaque response + blob");
26 </script>
27 </body>
28 </html>