mirror of
https://github.com/servo/servo.git
synced 2025-08-15 02:15:33 +01:00
Update web-platform-tests to revision e710d1d6bbe007a6a9344f79e17b445cf97cc623
This commit is contained in:
parent
ec408e9a57
commit
5a5336aaf0
1981 changed files with 64719 additions and 2377 deletions
|
@ -4,41 +4,48 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
const emptyChunk = new Uint8Array([]);
|
||||
const inputChunk = new Uint8Array([73, 32, 240, 159, 146, 153, 32, 115, 116,
|
||||
114, 101, 97, 109, 115]);
|
||||
const expectedOutputString = 'I \u{1F499} streams';
|
||||
["ArrayBuffer", "SharedArrayBuffer"].forEach((arrayBufferOrSharedArrayBuffer) => {
|
||||
const inputChunkData = [73, 32, 240, 159, 146, 153, 32, 115, 116,
|
||||
114, 101, 97, 109, 115]
|
||||
|
||||
promise_test(async () => {
|
||||
const input = readableStreamFromArray([inputChunk]);
|
||||
const output = input.pipeThrough(new TextDecoderStream());
|
||||
const array = await readableStreamToArray(output);
|
||||
assert_array_equals(array, [expectedOutputString],
|
||||
'the output should be in one chunk');
|
||||
}, 'decoding one UTF-8 chunk should give one output string');
|
||||
const emptyChunk = new Uint8Array(new self[arrayBufferOrSharedArrayBuffer](0));
|
||||
const inputChunk = new Uint8Array(new self[arrayBufferOrSharedArrayBuffer](inputChunkData.length));
|
||||
|
||||
promise_test(async () => {
|
||||
const input = readableStreamFromArray([emptyChunk]);
|
||||
const output = input.pipeThrough(new TextDecoderStream());
|
||||
const array = await readableStreamToArray(output);
|
||||
assert_array_equals(array, [], 'no chunks should be output');
|
||||
}, 'decoding an empty chunk should give no output chunks');
|
||||
inputChunk.set(inputChunkData);
|
||||
|
||||
promise_test(async () => {
|
||||
const input = readableStreamFromArray([emptyChunk, inputChunk]);
|
||||
const output = input.pipeThrough(new TextDecoderStream());
|
||||
const array = await readableStreamToArray(output);
|
||||
assert_array_equals(array, [expectedOutputString],
|
||||
'the output should be in one chunk');
|
||||
}, 'an initial empty chunk should be ignored');
|
||||
const expectedOutputString = 'I \u{1F499} streams';
|
||||
|
||||
promise_test(async () => {
|
||||
const input = readableStreamFromArray([inputChunk, emptyChunk]);
|
||||
const output = input.pipeThrough(new TextDecoderStream());
|
||||
const array = await readableStreamToArray(output);
|
||||
assert_array_equals(array, [expectedOutputString],
|
||||
'the output should be in one chunk');
|
||||
}, 'a trailing empty chunk should be ignored');
|
||||
promise_test(async () => {
|
||||
const input = readableStreamFromArray([inputChunk]);
|
||||
const output = input.pipeThrough(new TextDecoderStream());
|
||||
const array = await readableStreamToArray(output);
|
||||
assert_array_equals(array, [expectedOutputString],
|
||||
'the output should be in one chunk');
|
||||
}, 'decoding one UTF-8 chunk should give one output string - ' + arrayBufferOrSharedArrayBuffer);
|
||||
|
||||
promise_test(async () => {
|
||||
const input = readableStreamFromArray([emptyChunk]);
|
||||
const output = input.pipeThrough(new TextDecoderStream());
|
||||
const array = await readableStreamToArray(output);
|
||||
assert_array_equals(array, [], 'no chunks should be output');
|
||||
}, 'decoding an empty chunk should give no output chunks - ' + arrayBufferOrSharedArrayBuffer);
|
||||
|
||||
promise_test(async () => {
|
||||
const input = readableStreamFromArray([emptyChunk, inputChunk]);
|
||||
const output = input.pipeThrough(new TextDecoderStream());
|
||||
const array = await readableStreamToArray(output);
|
||||
assert_array_equals(array, [expectedOutputString],
|
||||
'the output should be in one chunk');
|
||||
}, 'an initial empty chunk should be ignored - ' + arrayBufferOrSharedArrayBuffer);
|
||||
|
||||
promise_test(async () => {
|
||||
const input = readableStreamFromArray([inputChunk, emptyChunk]);
|
||||
const output = input.pipeThrough(new TextDecoderStream());
|
||||
const array = await readableStreamToArray(output);
|
||||
assert_array_equals(array, [expectedOutputString],
|
||||
'the output should be in one chunk');
|
||||
}, 'a trailing empty chunk should be ignored- ' + arrayBufferOrSharedArrayBuffer);
|
||||
});
|
||||
|
||||
promise_test(async () => {
|
||||
const buffer = new ArrayBuffer(3);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue