-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR-URL: #43958 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Feng Yu <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
- Loading branch information
1 parent
51cb0d4
commit 198cf59
Showing
15 changed files
with
259 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Cross-Origin-Opener-Policy: same-origin | ||
Cross-Origin-Embedder-Policy: require-corp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// META: script=/resources/idlharness-shadowrealm.js | ||
idl_test_shadowrealm(["encoding"], ["streams"]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
|
||
test(() => { | ||
const decoder = new TextDecoder('utf-8'); | ||
const buffer = new SharedArrayBuffer(4); | ||
assert_throws_js(TypeError, () => { | ||
decoder.decode(new Uint8Array(buffer)); | ||
}, 'constructing TextDecoder with SharedArrayBuffer view should throw'); | ||
}, 'decoding SharedArrayBuffer'); | ||
|
||
</script> |
2 changes: 2 additions & 0 deletions
2
test/fixtures/wpt/encoding/sharedarraybuffer.https.html.headers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Cross-Origin-Opener-Policy:same-origin | ||
Cross-Origin-Embedder-Policy:require-corp |
107 changes: 107 additions & 0 deletions
107
test/fixtures/wpt/encoding/single-byte-decoder.window.js
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
test/fixtures/wpt/encoding/streams/decode-utf8.any.js.headers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Cross-Origin-Opener-Policy: same-origin | ||
Cross-Origin-Embedder-Policy: require-corp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Cross-Origin-Opener-Policy: same-origin | ||
Cross-Origin-Embedder-Policy: require-corp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
test(() => { | ||
// Truncated sequences | ||
assert_equals(new TextDecoder().decode(new Uint8Array([0xF0])), "\uFFFD"); | ||
assert_equals(new TextDecoder().decode(new Uint8Array([0xF0, 0x9F])), "\uFFFD"); | ||
assert_equals(new TextDecoder().decode(new Uint8Array([0xF0, 0x9F, 0x92])), "\uFFFD"); | ||
|
||
// Errors near end-of-queue | ||
assert_equals(new TextDecoder().decode(new Uint8Array([0xF0, 0x9F, 0x41])), "\uFFFDA"); | ||
assert_equals(new TextDecoder().decode(new Uint8Array([0xF0, 0x41, 0x42])), "\uFFFDAB"); | ||
assert_equals(new TextDecoder().decode(new Uint8Array([0xF0, 0x41, 0xF0])), "\uFFFDA\uFFFD"); | ||
assert_equals(new TextDecoder().decode(new Uint8Array([0xF0, 0x8F, 0x92])), "\uFFFD\uFFFD\uFFFD"); | ||
}, "TextDecoder end-of-queue handling"); | ||
|
||
test(() => { | ||
const decoder = new TextDecoder(); | ||
decoder.decode(new Uint8Array([0xF0]), { stream: true }); | ||
assert_equals(decoder.decode(), "\uFFFD"); | ||
|
||
decoder.decode(new Uint8Array([0xF0]), { stream: true }); | ||
decoder.decode(new Uint8Array([0x9F]), { stream: true }); | ||
assert_equals(decoder.decode(), "\uFFFD"); | ||
|
||
decoder.decode(new Uint8Array([0xF0, 0x9F]), { stream: true }); | ||
assert_equals(decoder.decode(new Uint8Array([0x92])), "\uFFFD"); | ||
|
||
assert_equals(decoder.decode(new Uint8Array([0xF0, 0x9F]), { stream: true }), ""); | ||
assert_equals(decoder.decode(new Uint8Array([0x41]), { stream: true }), "\uFFFDA"); | ||
assert_equals(decoder.decode(), ""); | ||
|
||
assert_equals(decoder.decode(new Uint8Array([0xF0, 0x41, 0x42]), { stream: true }), "\uFFFDAB"); | ||
assert_equals(decoder.decode(), ""); | ||
|
||
assert_equals(decoder.decode(new Uint8Array([0xF0, 0x41, 0xF0]), { stream: true }), "\uFFFDA"); | ||
assert_equals(decoder.decode(), "\uFFFD"); | ||
|
||
assert_equals(decoder.decode(new Uint8Array([0xF0]), { stream: true }), ""); | ||
assert_equals(decoder.decode(new Uint8Array([0x8F]), { stream: true }), "\uFFFD\uFFFD"); | ||
assert_equals(decoder.decode(new Uint8Array([0x92]), { stream: true }), "\uFFFD"); | ||
assert_equals(decoder.decode(), ""); | ||
}, "TextDecoder end-of-queue handling using stream: true"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
test/fixtures/wpt/encoding/textdecoder-streaming.any.js.headers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Cross-Origin-Opener-Policy: same-origin | ||
Cross-Origin-Embedder-Policy: require-corp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters