chromium/third_party/blink/web_tests/http/tests/streams/chromium/simple-queue-many-foreach.html

<!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>