Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FSA: Allow removing the root of an OPFS #37440

Merged
merged 1 commit into from
Dec 9, 2022
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');