Skip to content

Commit

Permalink
FSA: Reject with NoModificationAllowedError if AccessHandle is locked
Browse files Browse the repository at this point in the history
Spec PR: whatwg/fs#21
Comment: https://github.com/whatwg/fs/pull/21/files#r876204287

Updates the implementation to match the spec and to match other cases
where we reject a promise because of a locked file.

Bug: N/A
Change-Id: I201fa40a866ecace62c6fe77ad70cffce57c2553
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3653903
Reviewed-by: Marijn Kruisselbrink <[email protected]>
Auto-Submit: Austin Sullivan <[email protected]>
Commit-Queue: Marijn Kruisselbrink <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1005103}
  • Loading branch information
a-sully authored and chromium-wpt-export-bot committed May 19, 2022
1 parent 6f1407f commit cc1e80e
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ directory_test(async (t, root_dir) => {

const syncHandle1 = await fileHandle.createSyncAccessHandle();
await promise_rejects_dom(
t, 'InvalidStateError', fileHandle.createSyncAccessHandle());
t, 'NoModificationAllowedError', fileHandle.createSyncAccessHandle());

await syncHandle1.close();
const syncHandle2 = await fileHandle.createSyncAccessHandle();
Expand All @@ -24,7 +24,7 @@ directory_test(async (t, root_dir) => {

const barSyncHandle1 = await barFileHandle.createSyncAccessHandle();
await promise_rejects_dom(
t, 'InvalidStateError', barFileHandle.createSyncAccessHandle());
t, 'NoModificationAllowedError', barFileHandle.createSyncAccessHandle());

await barSyncHandle1.close();
const barSyncHandle2 = await barFileHandle.createSyncAccessHandle();
Expand Down Expand Up @@ -61,7 +61,7 @@ directory_test(async (t, root_dir) => {

const syncHandle = await fileHandle.createSyncAccessHandle();
await promise_rejects_dom(
t, 'InvalidStateError', fileHandle.createWritable());
t, 'NoModificationAllowedError', fileHandle.createWritable());

await syncHandle.close();
const writable = await fileHandle.createWritable();
Expand All @@ -74,11 +74,11 @@ directory_test(async (t, root_dir) => {
const writable1 = await fileHandle.createWritable();
const writable2 = await fileHandle.createWritable();
await promise_rejects_dom(
t, 'InvalidStateError', fileHandle.createSyncAccessHandle());
t, 'NoModificationAllowedError', fileHandle.createSyncAccessHandle());

await writable1.close();
await promise_rejects_dom(
t, 'InvalidStateError', fileHandle.createSyncAccessHandle());
t, 'NoModificationAllowedError', fileHandle.createSyncAccessHandle());

await writable2.close();
const syncHandle = await fileHandle.createSyncAccessHandle();
Expand Down

0 comments on commit cc1e80e

Please sign in to comment.