mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision eb12303bec1d47bbe91ebf011d17d81ec6fce68d
This commit is contained in:
parent
6ca767d7f9
commit
916ba6ef4d
467 changed files with 6716 additions and 1478 deletions
|
@ -1,3 +1,6 @@
|
|||
// META: global=window,worker
|
||||
// META: script=/common/sab.js
|
||||
|
||||
[
|
||||
{
|
||||
"input": "Hi",
|
||||
|
@ -77,15 +80,15 @@
|
|||
["ArrayBuffer", "SharedArrayBuffer"].forEach(arrayBufferOrSharedArrayBuffer => {
|
||||
test(() => {
|
||||
// Setup
|
||||
const bufferLength = testData.destinationLength + destinationData.bufferIncrease,
|
||||
destinationOffset = destinationData.destinationOffset,
|
||||
destinationLength = testData.destinationLength,
|
||||
destinationFiller = destinationData.filler,
|
||||
encoder = new TextEncoder(),
|
||||
buffer = new self[arrayBufferOrSharedArrayBuffer](bufferLength),
|
||||
view = new Uint8Array(buffer, destinationOffset, destinationLength),
|
||||
fullView = new Uint8Array(buffer),
|
||||
control = new Array(bufferLength);
|
||||
const bufferLength = testData.destinationLength + destinationData.bufferIncrease;
|
||||
const destinationOffset = destinationData.destinationOffset;
|
||||
const destinationLength = testData.destinationLength;
|
||||
const destinationFiller = destinationData.filler;
|
||||
const encoder = new TextEncoder();
|
||||
const buffer = createBuffer(arrayBufferOrSharedArrayBuffer, bufferLength);
|
||||
const view = new Uint8Array(buffer, destinationOffset, destinationLength);
|
||||
const fullView = new Uint8Array(buffer);
|
||||
const control = new Array(bufferLength);
|
||||
let byte = destinationFiller;
|
||||
for (let i = 0; i < bufferLength; i++) {
|
||||
if (destinationFiller === "random") {
|
||||
|
@ -128,19 +131,17 @@
|
|||
Float64Array].forEach(view => {
|
||||
["ArrayBuffer", "SharedArrayBuffer"].forEach((arrayBufferOrSharedArrayBuffer) => {
|
||||
test(() => {
|
||||
assert_throws_js(TypeError, () => new TextEncoder().encodeInto("", new view(new self[arrayBufferOrSharedArrayBuffer](0))));
|
||||
assert_throws_js(TypeError, () => new TextEncoder().encodeInto("", new view(createBuffer(arrayBufferOrSharedArrayBuffer, 0))));
|
||||
}, "Invalid encodeInto() destination: " + view.name + ", backed by: " + arrayBufferOrSharedArrayBuffer);
|
||||
});
|
||||
});
|
||||
|
||||
["ArrayBuffer", "SharedArrayBuffer"].forEach((arrayBufferOrSharedArrayBuffer) => {
|
||||
test(() => {
|
||||
assert_throws_js(TypeError, () => new TextEncoder().encodeInto("", new self[arrayBufferOrSharedArrayBuffer](10)));
|
||||
assert_throws_js(TypeError, () => new TextEncoder().encodeInto("", createBuffer(arrayBufferOrSharedArrayBuffer, 10)));
|
||||
}, "Invalid encodeInto() destination: " + arrayBufferOrSharedArrayBuffer);
|
||||
});
|
||||
|
||||
|
||||
|
||||
test(() => {
|
||||
const buffer = new ArrayBuffer(10),
|
||||
view = new Uint8Array(buffer);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue