blob: 97ffe9b07e8d3df689013a99c46fb742a3ca29bd [file] [log] [blame]
<!DOCTYPE html>
<meta charset="utf-8">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/simple-queue-common.js"></script>
<script>
// Verify that forEach() works. It is used by WritableStream when it needs to
// reject all outstanding promises to error the stream.
promise_test(t => {
const ws = new WritableStream();
const writer = ws.getWriter();
const rejections = [];
for (let i = 0; i < NUMBER_OF_WRITES; ++i) {
rejections.push(
promise_rejects_js(t, Error, writer.write(i),
'write() promise should reject'));
}
return writer.abort(new Error()).then(() => Promise.all(rejections));
}, 'rejecting more than 16K writes should work');
</script>