Skip to content

Commit b8f436c

Browse files
anonrigtargos
authored andcommitted
test: update encoding web-platform tests
PR-URL: #53477 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent ad5282e commit b8f436c

24 files changed

Lines changed: 102 additions & 10 deletions

‎test/fixtures/wpt/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Last update:
1515
- console: https://github.com/web-platform-tests/wpt/tree/767ae35464/console
1616
- dom/abort: https://github.com/web-platform-tests/wpt/tree/d1f1ecbd52/dom/abort
1717
- dom/events: https://github.com/web-platform-tests/wpt/tree/ab8999891c/dom/events
18-
- encoding: https://github.com/web-platform-tests/wpt/tree/a58bbf6d8c/encoding
18+
- encoding: https://github.com/web-platform-tests/wpt/tree/5aa50dd415/encoding
1919
- fetch/data-urls/resources: https://github.com/web-platform-tests/wpt/tree/7c79d998ff/fetch/data-urls/resources
2020
- FileAPI: https://github.com/web-platform-tests/wpt/tree/cceaf3628d/FileAPI
2121
- hr-time: https://github.com/web-platform-tests/wpt/tree/34cafd797e/hr-time

‎test/fixtures/wpt/encoding/api-basics.any.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// META: global=window,dedicatedworker,shadowrealm
12
// META: title=Encoding API: Basics
23

34
test(function(){

‎test/fixtures/wpt/encoding/api-surrogates-utf8.any.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// META: global=window,dedicatedworker,shadowrealm
12
// META: title=Encoding API: Invalid UTF-16 surrogates with UTF-8 encoding
23

34
varbadStrings=[

‎test/fixtures/wpt/encoding/encodeInto.any.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@
129129
"Uint8ClampedArray",
130130
"BigInt64Array",
131131
"BigUint64Array",
132+
"Float16Array",
132133
"Float32Array",
133134
"Float64Array"].forEach(type=>{
134135
["ArrayBuffer","SharedArrayBuffer"].forEach((arrayBufferOrSharedArrayBuffer)=>{

‎test/fixtures/wpt/encoding/iso-2022-jp-decoder.any.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// META: global=window,dedicatedworker,shadowrealm
2+
//
13
functiondecode(input,output,desc){
24
test(function(){
35
vard=newTextDecoder("iso-2022-jp"),

‎test/fixtures/wpt/encoding/legacy-mb-schinese/gb18030/gb18030-decoder.any.js‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,44 @@ decode([0x83, 0x36, 0xC8, 0x30], "\uE7C8", "legacy ICU special case 1");
4747
decode([0xA1,0xAD],"\u2026","legacy ICU special case 2");
4848
decode([0xA1,0xAB],"\uFF5E","legacy ICU special case 3");
4949

50+
// GB18030-2022
51+
decode([0xA6,0xD9],"\uFE10","GB18030-2022 1");
52+
decode([0xA6,0xDA],"\uFE12","GB18030-2022 2");
53+
decode([0xA6,0xDB],"\uFE11","GB18030-2022 3");
54+
decode([0xA6,0xDC],"\uFE13","GB18030-2022 4");
55+
decode([0xA6,0xDD],"\uFE14","GB18030-2022 5");
56+
decode([0xA6,0xDE],"\uFE15","GB18030-2022 6");
57+
decode([0xA6,0xDF],"\uFE16","GB18030-2022 7");
58+
decode([0xA6,0xEC],"\uFE17","GB18030-2022 8");
59+
decode([0xA6,0xED],"\uFE18","GB18030-2022 9");
60+
decode([0xA6,0xF3],"\uFE19","GB18030-2022 10");
61+
decode([0xFE,0x59],"\u9FB4","GB18030-2022 11");
62+
decode([0xFE,0x61],"\u9FB5","GB18030-2022 12");
63+
decode([0xFE,0x66],"\u9FB6","GB18030-2022 13");
64+
decode([0xFE,0x67],"\u9FB7","GB18030-2022 14");
65+
decode([0xFE,0x6D],"\u9FB8","GB18030-2022 15");
66+
decode([0xFE,0x7E],"\u9FB9","GB18030-2022 16");
67+
decode([0xFE,0x90],"\u9FBA","GB18030-2022 17");
68+
decode([0xFE,0xA0],"\u9FBB","GB18030-2022 18");
69+
decode([0x82,0x35,0x90,0x37],"\uE81E","GB18030-2022 19");
70+
decode([0x82,0x35,0x90,0x38],"\uE826","GB18030-2022 20");
71+
decode([0x82,0x35,0x90,0x39],"\uE82B","GB18030-2022 21");
72+
decode([0x82,0x35,0x91,0x30],"\uE82C","GB18030-2022 22");
73+
decode([0x82,0x35,0x91,0x31],"\uE832","GB18030-2022 23");
74+
decode([0x82,0x35,0x91,0x32],"\uE843","GB18030-2022 24");
75+
decode([0x82,0x35,0x91,0x33],"\uE854","GB18030-2022 25");
76+
decode([0x82,0x35,0x91,0x34],"\uE864","GB18030-2022 26");
77+
decode([0x84,0x31,0x82,0x36],"\uE78D","GB18030-2022 27");
78+
decode([0x84,0x31,0x82,0x37],"\uE78F","GB18030-2022 28");
79+
decode([0x84,0x31,0x82,0x38],"\uE78E","GB18030-2022 29");
80+
decode([0x84,0x31,0x82,0x39],"\uE790","GB18030-2022 30");
81+
decode([0x84,0x31,0x83,0x30],"\uE791","GB18030-2022 31");
82+
decode([0x84,0x31,0x83,0x31],"\uE792","GB18030-2022 32");
83+
decode([0x84,0x31,0x83,0x32],"\uE793","GB18030-2022 33");
84+
decode([0x84,0x31,0x83,0x33],"\uE794","GB18030-2022 34");
85+
decode([0x84,0x31,0x83,0x34],"\uE795","GB18030-2022 35");
86+
decode([0x84,0x31,0x83,0x35],"\uE796","GB18030-2022 36");
87+
5088
leti=0;
5189
for(constrangeofranges){
5290
constpointer=range[0];

‎test/fixtures/wpt/encoding/legacy-mb-schinese/gb18030/gb18030-encoder.html‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,44 @@
2424
encode("\u2026","%A1%AD","legacy ICU special case 2");
2525
encode("\uFF5E","%A1%AB","legacy ICU special case 3");
2626

27+
// GB18030-2022
28+
encode("\uFE10","%A6%D9","GB18030-2022 1");
29+
encode("\uFE12","%A6%DA","GB18030-2022 2");
30+
encode("\uFE11","%A6%DB","GB18030-2022 3");
31+
encode("\uFE13","%A6%DC","GB18030-2022 4");
32+
encode("\uFE14","%A6%DD","GB18030-2022 5");
33+
encode("\uFE15","%A6%DE","GB18030-2022 6");
34+
encode("\uFE16","%A6%DF","GB18030-2022 7");
35+
encode("\uFE17","%A6%EC","GB18030-2022 8");
36+
encode("\uFE18","%A6%ED","GB18030-2022 9");
37+
encode("\uFE19","%A6%F3","GB18030-2022 10");
38+
encode("\u9FB4","%FEY","GB18030-2022 11");
39+
encode("\u9FB5","%FEa","GB18030-2022 12");
40+
encode("\u9FB6","%FEf","GB18030-2022 13");
41+
encode("\u9FB7","%FEg","GB18030-2022 14");
42+
encode("\u9FB8","%FEm","GB18030-2022 15");
43+
encode("\u9FB9","%FE~","GB18030-2022 16");
44+
encode("\u9FBA","%FE%90","GB18030-2022 17");
45+
encode("\u9FBB","%FE%A0","GB18030-2022 18");
46+
encode("\uE78D","%841%826","GB18030-2022 19");
47+
encode("\uE78E","%841%828","GB18030-2022 20");
48+
encode("\uE78F","%841%827","GB18030-2022 21");
49+
encode("\uE790","%841%829","GB18030-2022 22");
50+
encode("\uE791","%841%830","GB18030-2022 23");
51+
encode("\uE792","%841%831","GB18030-2022 24");
52+
encode("\uE793","%841%832","GB18030-2022 25");
53+
encode("\uE794","%841%833","GB18030-2022 26");
54+
encode("\uE795","%841%834","GB18030-2022 27");
55+
encode("\uE796","%841%835","GB18030-2022 28");
56+
encode("\uE81E","%825%907","GB18030-2022 29");
57+
encode("\uE826","%825%908","GB18030-2022 30");
58+
encode("\uE82B","%825%909","GB18030-2022 31");
59+
encode("\uE82C","%825%910","GB18030-2022 32");
60+
encode("\uE832","%825%911","GB18030-2022 33");
61+
encode("\uE843","%825%912","GB18030-2022 34");
62+
encode("\uE854","%825%913","GB18030-2022 35");
63+
encode("\uE864","%825%914","GB18030-2022 36");
64+
2765
constupperCaseNibble=x=>{
2866
returnMath.floor(x).toString(16).toUpperCase();
2967
}
6.55 KB
Binary file not shown.
Binary file not shown.

‎test/fixtures/wpt/encoding/sharedarraybuffer.https.html‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
test(()=>{
77
constdecoder=newTextDecoder('utf-8');
88
constbuffer=newSharedArrayBuffer(4);
9-
assert_throws_js(TypeError,()=>{
10-
decoder.decode(newUint8Array(buffer));
11-
},'constructing TextDecoder with SharedArrayBuffer view should throw');
9+
assert_equals(decoder.decode(newUint8Array(buffer)),"\u0000\u0000\u0000\u0000");
1210
},'decoding SharedArrayBuffer');
1311

1412
</script>

0 commit comments

Comments
 (0)