| <html> |
| <head> |
| <meta charset="utf-8"> |
| <script src="../../resources/testharness.js"></script> |
| <script src="../../resources/testharnessreport.js"></script> |
| </head> |
| <body> |
| <script> |
| promise_test(async t => { |
| const blob = new Blob(new Uint8Array(512 * 1024 * 10)); |
| const reader = blob.stream().getReader(); |
| |
| let result = await reader.read(); |
| assert_false(result.done); |
| while (!result.done) |
| result = await reader.read(); |
| await reader.closed.then(() => { }, () => { }); |
| }, "Process blob data as chunks"); |
| |
| promise_test(async t => { |
| const blob = new Blob(new Uint8Array(512 * 1024 * 10)); |
| const reader = blob.stream().getReader(); |
| |
| const result = await reader.read(); |
| assert_false(result.done); |
| reader.cancel(); |
| await reader.closed.then(() => { }, () => { }); |
| }, "Cancel load while chunks are flowing"); |
| </script> |
| </body> |
| </html> |