Commit 81851a93 authored by Nidhi Jaju's avatar Nidhi Jaju Committed by Chromium LUCI CQ

Add WPT that checks autoAllocateChunkSize cannot be 0

This CL adds a new WPT for the case that a ReadableStream with a byte
source, and hence a ReadableByteStreamController is constructed, with
autoAllocateChunkSize: 0. This should throw a Type Error because
autoAllocateChunkSize cannot be 0, and should rather be positive.

Bug: 614302
Change-Id: Iea15e4730f4965d52ff5c68367ba6212d5eca089
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2569490
Commit-Queue: Nidhi Jaju <nidhijaju@google.com>
Reviewed-by: default avatarAdam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834112}
parent d6d1d0f2
...@@ -2055,6 +2055,11 @@ promise_test(() => { ...@@ -2055,6 +2055,11 @@ promise_test(() => {
return readPromise; return readPromise;
}, 'ReadableStream with byte source: default reader + autoAllocateChunkSize + byobRequest interaction'); }, 'ReadableStream with byte source: default reader + autoAllocateChunkSize + byobRequest interaction');
test(() => {
assert_throws_js(TypeError, () => new ReadableStream({ autoAllocateChunkSize: 0, type: 'bytes' }),
'controller cannot be setup with autoAllocateChunkSize = 0');
}, 'ReadableStream with byte source: autoAllocateChunkSize cannot be 0');
test(() => { test(() => {
const ReadableStreamBYOBReader = new ReadableStream({ type: 'bytes' }).getReader({ mode: 'byob' }).constructor; const ReadableStreamBYOBReader = new ReadableStream({ type: 'bytes' }).getReader({ mode: 'byob' }).constructor;
const stream = new ReadableStream({ type: 'bytes' }); const stream = new ReadableStream({ type: 'bytes' });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment