Skip to content

Commit 2679002

Browse files
a-sullychromium-wpt-export-bot
authored andcommitted
FSA: Allow removing the root of an OPFS
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}
1 parent 574f5c5 commit 2679002

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

file-system-access/script-tests/FileSystemBaseHandle-remove.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,12 @@ directory_test(async (t, root) => {
9494

9595
promise_test(async (t) => {
9696
const root = await navigator.storage.getDirectory();
97-
await promise_rejects_dom(t, 'NoModificationAllowedError', root.remove());
98-
}, 'cannot remove the root of a sandbox file system');
97+
await root.getFileHandle('file.txt', {create: true});
98+
assert_array_equals(await getSortedDirectoryEntries(root), ['file.txt']);
99+
100+
await root.remove();
101+
102+
// Creates a fresh sandboxed file system.
103+
const newRoot = await navigator.storage.getDirectory();
104+
assert_array_equals(await getSortedDirectoryEntries(newRoot), []);
105+
}, 'can remove the root of a sandbox file system');

0 commit comments

Comments
 (0)