Skip to content

Commit

Permalink
FSA: Update error code when attempting to remove sandbox root
Browse files Browse the repository at this point in the history
Before: reject promise with InvalidStateError
After:  reject promise with NoModificationAllowedError

Also updates wpt to run on both sandboxed and local backends, which
will allow us to move it to the fs/ repo once the remove() PR lands.

Bug: 1114923, 1327741
Change-Id: I54629eb0849e71d95881e1e03f25bfae4211dae8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3671699
Reviewed-by: Ayu Ishii <[email protected]>
Auto-Submit: Austin Sullivan <[email protected]>
Commit-Queue: Ayu Ishii <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1009320}
  • Loading branch information
a-sully authored and chromium-wpt-export-bot committed May 31, 2022
1 parent b680c64 commit 9a7bbe4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// META: script=resources/test-helpers.js
// META: script=../fs/resources/sandboxed-fs-test-helpers.js
// META: script=script-tests/FileSystemBaseHandle-remove.js

directory_test(async (t, root) => {
await promise_rejects_dom(t, 'InvalidStateError', root.remove());
}, 'cannot remove the root of a sandbox file system');
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,8 @@ directory_test(async (t, root) => {
assert_array_equals(await getSortedDirectoryEntries(root), ['file-to-keep']);
await promise_rejects_dom(t, 'NotFoundError', getFileContents(handle));
}, 'remove() while the file has an open writable fails');

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');

0 comments on commit 9a7bbe4

Please sign in to comment.