Skip to content

Commit

Permalink
Add WPT test for OPFS that CreateWritable fails after remove()
Browse files Browse the repository at this point in the history
Differential Revision: https://phabricator.services.mozilla.com/D160446

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1797671
gecko-commit: a8fc94c19d5bc9da9d1befb16d11d1218b462331
gecko-reviewers: dom-storage-reviewers, jari
  • Loading branch information
moz-wptsync-bot committed Jan 9, 2023
1 parent 5579e43 commit e9470cd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions fs/script-tests/FileSystemDirectoryHandle-removeEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,15 @@ directory_test(async (t, root) => {
await dir.removeEntry('file-to-remove');
assert_array_equals(await getSortedDirectoryEntries(dir), ['file-to-keep']);
}, 'removeEntry() of a directory while a containing file has an open writable fails');

directory_test(async (t, root) => {
const handle =
await createFileWithContents(t, 'file-to-remove', '12345', root);
await root.removeEntry('file-to-remove');

await promise_rejects_dom(t, 'NotFoundError', cleanup_writable(t, handle.createWritable({keepExistingData: true})));

assert_array_equals(
await getSortedDirectoryEntries(root),
[]);
}, 'createWritable after removeEntry succeeds but doesnt recreate the file');

1 comment on commit e9470cd

@community-tc-integration
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh oh! Looks like an error! Details

HttpError: You have exceeded a secondary rate limit. Please wait a few minutes before you try again.

Please sign in to comment.