mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Update web-platform-tests to revision b'b728032f59a396243864b0f8584e7211e3632005'
This commit is contained in:
parent
ace9b32b1c
commit
df68c4e5d1
15632 changed files with 514865 additions and 155000 deletions
|
@ -27,7 +27,6 @@ directory_test(async (t, root) => {
|
|||
assert_array_equals(await getSortedDirectoryEntries(dir), ['file-in-dir']);
|
||||
}, 'move(name) to rename a non-empty directory');
|
||||
|
||||
|
||||
directory_test(async (t, root) => {
|
||||
const dir = await root.getDirectoryHandle('dir-before', {create: true});
|
||||
await dir.move(root, 'dir-after');
|
||||
|
@ -50,7 +49,7 @@ directory_test(async (t, root) => {
|
|||
const dir_dest = await root.getDirectoryHandle('dir-dest', {create: true});
|
||||
const dir_in_dir =
|
||||
await dir_src.getDirectoryHandle('dir-in-dir', {create: true});
|
||||
await dir_in_dir.move(dir_dest, "");
|
||||
await dir_in_dir.move(dir_dest);
|
||||
|
||||
assert_array_equals(
|
||||
await getSortedDirectoryEntries(root), ['dir-dest/', 'dir-src/']);
|
||||
|
@ -58,7 +57,7 @@ directory_test(async (t, root) => {
|
|||
assert_array_equals(
|
||||
await getSortedDirectoryEntries(dir_dest), ['dir-in-dir/']);
|
||||
assert_array_equals(await getSortedDirectoryEntries(dir_in_dir), []);
|
||||
}, 'move(dir, "") to move an empty directory to a new directory');
|
||||
}, 'move(dir) to move an empty directory to a new directory');
|
||||
|
||||
directory_test(async (t, root) => {
|
||||
const dir_src = await root.getDirectoryHandle('dir-src', {create: true});
|
||||
|
@ -82,7 +81,7 @@ directory_test(async (t, root) => {
|
|||
await dir_src.getDirectoryHandle('dir-in-dir', {create: true});
|
||||
const file =
|
||||
await createFileWithContents(t, 'file-in-dir', 'abc', dir_in_dir);
|
||||
await dir_in_dir.move(dir_dest, "");
|
||||
await dir_in_dir.move(dir_dest);
|
||||
|
||||
assert_array_equals(
|
||||
await getSortedDirectoryEntries(root), ['dir-dest/', 'dir-src/']);
|
||||
|
@ -93,7 +92,7 @@ directory_test(async (t, root) => {
|
|||
await getSortedDirectoryEntries(dir_in_dir), ['file-in-dir']);
|
||||
// `file` should be invalidated after moving directories.
|
||||
await promise_rejects_dom(t, 'NotFoundError', getFileContents(file));
|
||||
}, 'move(dir, "") to move a non-empty directory to a new directory');
|
||||
}, 'move(dir) to move a non-empty directory to a new directory');
|
||||
|
||||
directory_test(async (t, root) => {
|
||||
const dir_src = await root.getDirectoryHandle('dir-src', {create: true});
|
||||
|
@ -142,33 +141,6 @@ directory_test(async (t, root) => {
|
|||
assert_equals(await getFileContents(handle), 'foo');
|
||||
}, 'move(dir) can be called multiple times');
|
||||
|
||||
directory_test(async (t, root) => {
|
||||
const dir1 = await root.getDirectoryHandle('dir1', {create: true});
|
||||
const dir2 = await root.getDirectoryHandle('dir2', {create: true});
|
||||
const handle = await createFileWithContents(t, 'file', 'foo', root);
|
||||
|
||||
await handle.move(dir1, "");
|
||||
assert_array_equals(
|
||||
await getSortedDirectoryEntries(root), ['dir1/', 'dir2/']);
|
||||
assert_array_equals(await getSortedDirectoryEntries(dir1), ['file']);
|
||||
assert_array_equals(await getSortedDirectoryEntries(dir2), []);
|
||||
assert_equals(await getFileContents(handle), 'foo');
|
||||
|
||||
await handle.move(dir2, "");
|
||||
assert_array_equals(
|
||||
await getSortedDirectoryEntries(root), ['dir1/', 'dir2/']);
|
||||
assert_array_equals(await getSortedDirectoryEntries(dir1), []);
|
||||
assert_array_equals(await getSortedDirectoryEntries(dir2), ['file']);
|
||||
assert_equals(await getFileContents(handle), 'foo');
|
||||
|
||||
await handle.move(root, "");
|
||||
assert_array_equals(
|
||||
await getSortedDirectoryEntries(root), ['dir1/', 'dir2/', 'file']);
|
||||
assert_array_equals(await getSortedDirectoryEntries(dir1), []);
|
||||
assert_array_equals(await getSortedDirectoryEntries(dir2), []);
|
||||
assert_equals(await getFileContents(handle), 'foo');
|
||||
}, 'move(dir, "") can be called multiple times');
|
||||
|
||||
directory_test(async (t, root) => {
|
||||
const dir1 = await root.getDirectoryHandle('dir1', {create: true});
|
||||
const dir2 = await root.getDirectoryHandle('dir2', {create: true});
|
||||
|
@ -198,13 +170,44 @@ directory_test(async (t, root) => {
|
|||
|
||||
directory_test(async (t, root) => {
|
||||
const handle = await createFileWithContents(t, 'file-before', 'foo', root);
|
||||
const valid_name = '#$23423@352^*3243';
|
||||
await handle.move(root, valid_name);
|
||||
|
||||
assert_array_equals(await getSortedDirectoryEntries(root), [valid_name]);
|
||||
assert_equals(await getFileContents(handle), 'foo');
|
||||
assert_equals(await getFileSize(handle), 3);
|
||||
|
||||
const contains_invalid_characters = '/file\\';
|
||||
await promise_rejects_js(
|
||||
t, TypeError, handle.move(root, '#$23423@352^*3243'));
|
||||
t, TypeError, handle.move(root, contains_invalid_characters));
|
||||
|
||||
assert_array_equals(await getSortedDirectoryEntries(root), [valid_name]);
|
||||
assert_equals(await getFileContents(handle), 'foo');
|
||||
assert_equals(await getFileSize(handle), 3);
|
||||
|
||||
const empty_name = '';
|
||||
await promise_rejects_js(t, TypeError, handle.move(root, empty_name));
|
||||
|
||||
assert_array_equals(await getSortedDirectoryEntries(root), [valid_name]);
|
||||
assert_equals(await getFileContents(handle), 'foo');
|
||||
assert_equals(await getFileSize(handle), 3);
|
||||
|
||||
const banned_name = '..';
|
||||
await promise_rejects_js(t, TypeError, handle.move(root, banned_name));
|
||||
|
||||
assert_array_equals(await getSortedDirectoryEntries(root), [valid_name]);
|
||||
assert_equals(await getFileContents(handle), 'foo');
|
||||
assert_equals(await getFileSize(handle), 3);
|
||||
}, 'move(dir, name) with a name with invalid characters should fail');
|
||||
|
||||
directory_test(async (t, root) => {
|
||||
const handle = await createFileWithContents(t, 'file-before', 'foo', root);
|
||||
await promise_rejects_js(t, TypeError, handle.move(root, ''));
|
||||
|
||||
assert_array_equals(await getSortedDirectoryEntries(root), ['file-before']);
|
||||
assert_equals(await getFileContents(handle), 'foo');
|
||||
assert_equals(await getFileSize(handle), 3);
|
||||
}, 'move(dir, name) with a name with invalid characters should fail');
|
||||
}, 'move(dir, "") should fail');
|
||||
|
||||
directory_test(async (t, root) => {
|
||||
const dir = await root.getDirectoryHandle('dir', {create: true});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue