GeezerVison is showing github.com — test: update WPT encoding tests · nodejs/node@198cf59
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: test/fixtures/wpt/README.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -14,7 +14,7 @@ Last update: | 14 | 14 | - console: https://github.com/web-platform-tests/wpt/tree/3b1f72e99a/console | 15 | 15 | - dom/abort: https://github.com/web-platform-tests/wpt/tree/c49cafb491/dom/abort | 16 | 16 | - dom/events: https://github.com/web-platform-tests/wpt/tree/f8821adb28/dom/events | 17 | | -- encoding: https://github.com/web-platform-tests/wpt/tree/35f70910d3/encoding | | 17 | +- encoding: https://github.com/web-platform-tests/wpt/tree/c1b24fce6e/encoding | 18 | 18 | - FileAPI: https://github.com/web-platform-tests/wpt/tree/3b279420d4/FileAPI | 19 | 19 | - hr-time: https://github.com/web-platform-tests/wpt/tree/9910784394/hr-time | 20 | 20 | - html/webappapis/atob: https://github.com/web-platform-tests/wpt/tree/f267e1dca6/html/webappapis/atob | |
Collapse file Copy file name to clipboardExpand all lines: test/fixtures/wpt/encoding/encodeInto.any.js +14-11Lines changed: 14 additions & 11 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 120 | 120 | }); | 121 | 121 | }); | 122 | 122 |
| 123 | | -[DataView, | 124 | | - Int8Array, | 125 | | - Int16Array, | 126 | | - Int32Array, | 127 | | - Uint16Array, | 128 | | - Uint32Array, | 129 | | - Uint8ClampedArray, | 130 | | - Float32Array, | 131 | | - Float64Array].forEach(view => { | | 123 | +["DataView", | | 124 | + "Int8Array", | | 125 | + "Int16Array", | | 126 | + "Int32Array", | | 127 | + "Uint16Array", | | 128 | + "Uint32Array", | | 129 | + "Uint8ClampedArray", | | 130 | + "BigInt64Array", | | 131 | + "BigUint64Array", | | 132 | + "Float32Array", | | 133 | + "Float64Array"].forEach(type => { | 132 | 134 | ["ArrayBuffer", "SharedArrayBuffer"].forEach((arrayBufferOrSharedArrayBuffer) => { | 133 | 135 | test(() => { | 134 | | - assert_throws_js(TypeError, () => new TextEncoder().encodeInto("", new view(createBuffer(arrayBufferOrSharedArrayBuffer, 0)))); | 135 | | - }, "Invalid encodeInto() destination: " + view.name + ", backed by: " + arrayBufferOrSharedArrayBuffer); | | 136 | + const viewInstance = new self[type](createBuffer(arrayBufferOrSharedArrayBuffer, 0)); | | 137 | + assert_throws_js(TypeError, () => new TextEncoder().encodeInto("", viewInstance)); | | 138 | + }, "Invalid encodeInto() destination: " + type + ", backed by: " + arrayBufferOrSharedArrayBuffer); | 136 | 139 | }); | 137 | 140 | }); | 138 | 141 |
| |
Collapse file Copy file name to clipboard +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +Cross-Origin-Opener-Policy: same-origin | | 2 | +Cross-Origin-Embedder-Policy: require-corp |
Collapse file Copy file name to clipboard +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +// META: script=/resources/idlharness-shadowrealm.js | | 2 | +idl_test_shadowrealm(["encoding"], ["streams"]); |
Collapse file Copy file name to clipboard +14Lines changed: 14 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +<!DOCTYPE html> | | 2 | +<script src="/resources/testharness.js"></script> | | 3 | +<script src="/resources/testharnessreport.js"></script> | | 4 | +<script> | | 5 | + | | 6 | +test(() => { | | 7 | + const decoder = new TextDecoder('utf-8'); | | 8 | + const buffer = new SharedArrayBuffer(4); | | 9 | + assert_throws_js(TypeError, () => { | | 10 | + decoder.decode(new Uint8Array(buffer)); | | 11 | + }, 'constructing TextDecoder with SharedArrayBuffer view should throw'); | | 12 | +}, 'decoding SharedArrayBuffer'); | | 13 | + | | 14 | +</script> |
Collapse file Copy file name to clipboard +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +Cross-Origin-Opener-Policy:same-origin | | 2 | +Cross-Origin-Embedder-Policy:require-corp |
Collapse file Copy file name to clipboardExpand all lines: test/fixtures/wpt/encoding/single-byte-decoder.window.js +107Lines changed: 107 additions & 0 deletions Collapse file Copy file name to clipboardExpand all lines: test/fixtures/wpt/encoding/streams/decode-utf8.any.js +10-1Lines changed: 10 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 43 | 43 | const array = await readableStreamToArray(output); | 44 | 44 | assert_array_equals(array, [expectedOutputString], | 45 | 45 | 'the output should be in one chunk'); | 46 | | - }, 'a trailing empty chunk should be ignored- ' + arrayBufferOrSharedArrayBuffer); | | 46 | + }, 'a trailing empty chunk should be ignored - ' + arrayBufferOrSharedArrayBuffer); | | 47 | + | | 48 | + promise_test(async () => { | | 49 | + const chunk = new Uint8Array(createBuffer(arrayBufferOrSharedArrayBuffer, 3)); | | 50 | + chunk.set([0xF0, 0x9F, 0x92]); | | 51 | + const input = readableStreamFromArray([chunk]); | | 52 | + const output = input.pipeThrough(new TextDecoderStream()); | | 53 | + const array = await readableStreamToArray(output); | | 54 | + assert_array_equals(array, ['\uFFFD']); | | 55 | + }, 'UTF-8 EOF handling - ' + arrayBufferOrSharedArrayBuffer); | 47 | 56 | }); | 48 | 57 |
| 49 | 58 | promise_test(async () => { | |
Collapse file Copy file name to clipboard +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +Cross-Origin-Opener-Policy: same-origin | | 2 | +Cross-Origin-Embedder-Policy: require-corp |
Collapse file Copy file name to clipboard +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +Cross-Origin-Opener-Policy: same-origin | | 2 | +Cross-Origin-Embedder-Policy: require-corp |
|