Update web-platform-tests to revision b464d69274950c7707855c0b29729d58b9a8d492

This commit is contained in:
WPT Sync Bot 2020-12-05 08:22:48 +00:00
parent 93c31df551
commit b505991695
92 changed files with 1750 additions and 119 deletions

View file

@ -0,0 +1,25 @@
'use strict';
// Read all the chunks from a stream that returns BufferSource objects and
// concatenate them into a single Uint8Array.
async function concatenateStream(readableStream) {
const reader = readableStream.getReader();
let totalSize = 0;
const buffers = [];
while (true) {
const { value, done } = await reader.read();
if (done) {
break;
}
buffers.push(value);
totalSize += value.byteLength;
}
reader.releaseLock();
const concatenated = new Uint8Array(totalSize);
let offset = 0;
for (const buffer of buffers) {
concatenated.set(buffer, offset);
offset += buffer.byteLength;
}
return concatenated;
}