Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions file-system-access/script-tests/FileSystemBaseHandle-remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,12 @@ directory_test(async (t, root) => {

promise_test(async (t) => {
const root = await navigator.storage.getDirectory();
await promise_rejects_dom(t, 'NoModificationAllowedError', root.remove());
}, 'cannot remove the root of a sandbox file system');
await root.getFileHandle('file.txt', {create: true});
assert_array_equals(await getSortedDirectoryEntries(root), ['file.txt']);

await root.remove();

// Creates a fresh sandboxed file system.
const newRoot = await navigator.storage.getDirectory();
assert_array_equals(await getSortedDirectoryEntries(newRoot), []);
}, 'can remove the root of a sandbox file system');