���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /home/real/node-v13.0.1/test/fixtures/wpt/encoding/streams/ |
// META: global=worker // META: script=resources/readable-stream-from-array.js // META: script=resources/readable-stream-to-array.js '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'; 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'); 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'); 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'); 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 buffer = new ArrayBuffer(3); const view = new Uint8Array(buffer, 1, 1); view[0] = 65; new MessageChannel().port1.postMessage(buffer, [buffer]); const input = readableStreamFromArray([view]); const output = input.pipeThrough(new TextDecoderStream()); const array = await readableStreamToArray(output); assert_array_equals(array, [], 'no chunks should be output'); }, 'decoding a transferred Uint8Array chunk should give no output'); promise_test(async () => { const buffer = new ArrayBuffer(1); new MessageChannel().port1.postMessage(buffer, [buffer]); const input = readableStreamFromArray([buffer]); const output = input.pipeThrough(new TextDecoderStream()); const array = await readableStreamToArray(output); assert_array_equals(array, [], 'no chunks should be output'); }, 'decoding a transferred ArrayBuffer chunk should give no output');