Skip to content

Commit

Permalink
Add more tests for BigInt64Array and BigUint64Array
Browse files Browse the repository at this point in the history
  • Loading branch information
ExE-Boss committed Mar 11, 2021
1 parent 12a2723 commit 74404bf
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
11 changes: 10 additions & 1 deletion FileAPI/blob/Blob-constructor.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,16 @@ test_blob(function() {
desc: "Passing a Float64Array as element of the blobParts array should work."
});


test_blob(function() {
return new Blob([
new BigInt64Array([BigInt("0x5353415053534150")]),
new BigUint64Array([BigInt("0x5353415053534150")])
]);
}, {
expected: "PASSPASSPASSPASS",
type: "",
desc: "Passing BigInt typed arrays as elements of the blobParts array should work."
});

var t_ports = async_test("Passing a FrozenArray as the blobParts array should work (FrozenArray<MessagePort>).");
t_ports.step(function() {
Expand Down
5 changes: 4 additions & 1 deletion encoding/encodeInto.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,14 @@
Uint16Array,
Uint32Array,
Uint8ClampedArray,
typeof BigInt64Array === "function" ? BigInt64Array : undefined,
typeof BigUint64Array === "function" ? BigUint64Array : undefined,
Float32Array,
Float64Array].forEach(view => {
["ArrayBuffer", "SharedArrayBuffer"].forEach((arrayBufferOrSharedArrayBuffer) => {
test(() => {
assert_throws_js(TypeError, () => new TextEncoder().encodeInto("", new view(createBuffer(arrayBufferOrSharedArrayBuffer, 0))));
const viewInstance = new view(createBuffer(arrayBufferOrSharedArrayBuffer, 0));
assert_throws_js(TypeError, () => new TextEncoder().encodeInto("", viewInstance));
}, "Invalid encodeInto() destination: " + view.name + ", backed by: " + arrayBufferOrSharedArrayBuffer);
});
});
Expand Down
2 changes: 2 additions & 0 deletions fetch/api/response/response-clone.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ testReadableStreamClone(new Uint8Array(arrayBuffer), "Uint8Array");
testReadableStreamClone(new Uint8ClampedArray(arrayBuffer), "Uint8ClampedArray");
testReadableStreamClone(new Uint16Array(arrayBuffer, 2), "Uint16Array");
testReadableStreamClone(new Uint32Array(arrayBuffer), "Uint32Array");
testReadableStreamClone(typeof BigInt64Array === "function" ? new BigInt64Array(arrayBuffer) : undefined, "BigInt64Array");
testReadableStreamClone(typeof BigUint64Array === "function" ? new BigUint64Array(arrayBuffer) : undefined, "BigUint64Array");
testReadableStreamClone(new Float32Array(arrayBuffer), "Float32Array");
testReadableStreamClone(new Float64Array(arrayBuffer), "Float64Array");
testReadableStreamClone(new DataView(arrayBuffer, 2, 8), "DataView");
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"Uint16Array",
"Int32Array",
"Uint32Array",
"BigInt64Array",
"BigUint64Array",
"Float32Array",
"Float64Array"
].forEach(type => {
Expand Down
3 changes: 2 additions & 1 deletion xhr/send-data-sharedarraybuffer.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ test(() => {
}, "sending a SharedArrayBuffer");

["Int8Array", "Uint8Array", "Uint8ClampedArray", "Int16Array", "Uint16Array",
"Int32Array", "Uint32Array", "Float32Array", "Float64Array", "DataView"].forEach((type) => {
"Int32Array", "Uint32Array", "BigInt64Array", "BigUint64Array",
"Float32Array", "Float64Array", "DataView"].forEach((type) => {
test(() => {
const xhr = new XMLHttpRequest();
// See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()`
Expand Down

0 comments on commit 74404bf

Please sign in to comment.