blob: 0c16ee79cc4d5dcfaa49ac0285d6f09bdc0535d6 [file] [edit]
<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>