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
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4090632
Auto-Submit: Austin Sullivan <[email protected]>
Reviewed-by: Daseul Lee <[email protected]>
Commit-Queue: Austin Sullivan <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1081696}
  • Loading branch information
a-sully authored and chromium-wpt-export-bot committed Dec 9, 2022
1 parent 574f5c5 commit 1a3f3a5
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 1a3f3a5

Please sign in to comment.