| <!doctype html> |
| <html> |
| <head> |
| <meta charset="utf-8"> |
| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| </head> |
| <body> |
| <script> |
| promise_test(async () => { |
| const request = new Request("/hot-potato"); |
| const stream = new ReadableStream({ |
| type: "bytes", |
| start : c => { |
| for (let i = 0; i < 32000; ++i) |
| c.enqueue(new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7])); |
| c.close(); |
| } |
| }); |
| await new Promise(resolve => setTimeout(resolve, 10)); |
| const response = new Response(stream); |
| |
| const cache = await self.caches.open("test"); |
| await cache.put(request, response); |
| }, "Put response with plenty of chunks in DOM cache"); |
| </script> |
| </body> |
| </html> |