too-big-array-buffer.js (500B)
1 add_task(async function helper() { 2 // Note: this test assumes the largest possible ArrayBuffer is 3 // smaller than 20GB -- if that changes, this test will fail. 4 let rs = new ReadableStream({ 5 type: "bytes", 6 autoAllocateChunkSize: 20 * 1024 * 1024 * 1024, 7 }); 8 let reader = rs.getReader(); 9 try { 10 await reader.read(); 11 Assert.equal(true, false, "Shouldn't succeed at reading"); 12 } catch (e) { 13 Assert.equal(e instanceof RangeError, true, "Should throw RangeError"); 14 } 15 });