| <!doctype html> |
| <html> |
| <head> |
| <meta charset="utf-8"> |
| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| </head> |
| <body> |
| <script> |
| function with_iframe(url) { |
| return new Promise(function(resolve) { |
| var frame = document.createElement('iframe'); |
| frame.srcdoc = url; |
| frame.onload = function() { resolve(frame); }; |
| document.body.appendChild(frame); |
| }); |
| } |
| |
| promise_test(async (t) => { |
| const frame = await with_iframe('/'); |
| const stream = new frame.contentWindow.ReadableStream({ start : c => { |
| c.enqueue(new ArrayBuffer(8)); |
| c.close(); |
| }}); |
| const response = new Response(stream); |
| frame.remove(); |
| return promise_rejects_js(t, TypeError, response.arrayBuffer()); |
| }, "Load response body from stream of a removed frame"); |
| </script> |
| </body> |
| </html> |