Update web-platform-tests to revision eb12303bec1d47bbe91ebf011d17d81ec6fce68d

This commit is contained in:
WPT Sync Bot 2020-03-25 08:18:42 +00:00
parent 6ca767d7f9
commit 916ba6ef4d
467 changed files with 6716 additions and 1478 deletions

View file

@ -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);