Skip to content

Commit

Permalink
FSA: Allow removing the root of an OPFS
Browse files Browse the repository at this point in the history
Removes the extra check added in https://crrev.com/c/3123735. See
recent discussion on the spec here:
whatwg/fs#9 (comment)

Bug: 1114923, 1399660
Change-Id: I0afd561238ae44dfa055e6fff234e801ee8de616
  • Loading branch information
a-sully authored and chromium-wpt-export-bot committed Dec 9, 2022
1 parent 88b961b commit fe12d8e
Showing 1 changed file with 9 additions and 2 deletions.
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');

0 comments on commit fe12d8e

Please sign in to comment.