Skip to content

Commit d75147b

Browse files
fivedotsmoz-wptsync-bot
authored andcommitted
Bug 1763185 [wpt PR 33516] - Revert "Add options parameter to createSyncAccessHandle()", a=testonly
Automatic update from web-platform-tests Revert "Add options parameter to createSyncAccessHandle()" This reverts commit ca2d8b837fca8a7bd3bd0ba1562c7cc090108374. Reason for revert: To avoid compatibility issues with Safari (that has already shipped this API without the options param) and leave the design of the object fully open, we decided to remove the parameter. Further context in whatwg/fs#19. Original change's description: > Add options parameter to createSyncAccessHandle() > > For now the only accepted (and required) option is "mode: 'in-place'". > Having this parameter allows us to later define a more appropriate > default behavior for access handles than the one we currently implement. > This is specially useful in the context of expanding access handle usage > outside of OPFS. > > For more details check: > https://github.com/WICG/file-system-access/blob/main/AccessHandle.md#exposing-accesshandles-on-all-filesystems > > Bug: 1218431 > Change-Id: I50d0a4acfd81874e17b6b28d1c2bf446b0397a4d > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3110487 > Reviewed-by: Marijn Kruisselbrink <[email protected]> > Commit-Queue: Emanuel Krivoy <[email protected]> > Cr-Commit-Position: refs/heads/main@{#982209} Bug: 1218431 Change-Id: I11dd5044b59e1fec8444242869628129efa5cf17 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3572141 Reviewed-by: Austin Sullivan <[email protected]> Commit-Queue: Emanuel Krivoy <[email protected]> Cr-Commit-Position: refs/heads/main@{#989350} -- wpt-commits: 9082234ee4b01d20a4e9eec0297155e2e5f6838f wpt-pr: 33516
1 parent e8918c0 commit d75147b

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

testing/web-platform/tests/file-system-access/resources/message-target.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ function add_message_event_handlers(receiver, target, target_origin) {
108108
// success to the sender.
109109
let success = true;
110110
try {
111-
const access_handle = await message_data.file_handle
112-
.createSyncAccessHandle({mode: "in-place"});
111+
const access_handle = await message_data.file_handle.createSyncAccessHandle();
113112
await access_handle.close();
114113
} catch (error) {
115114
success = false;

testing/web-platform/tests/file-system-access/resources/sync-access-handle-test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ function sync_access_handle_test(test, description) {
1010
await cleanupSandboxedFileSystem();
1111
const dir = await navigator.storage.getDirectory();
1212
const fileHandle = await dir.getFileHandle('OPFS.test', {create: true});
13-
const syncHandle = await fileHandle
14-
.createSyncAccessHandle({mode: "in-place"});
13+
const syncHandle = await fileHandle.createSyncAccessHandle();
1514
await test(t, syncHandle);
1615
await syncHandle.close();
1716
}, description);

testing/web-platform/tests/file-system-access/sandboxed_FileSystemFileHandle-sync-access-handle-writable-lock.https.tentative.worker.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,28 @@ importScripts('resources/sandboxed-fs-test-helpers.js');
66
directory_test(async (t, root_dir) => {
77
const fileHandle = await root_dir.getFileHandle('OPFS.test', {create: true});
88

9-
const syncHandle1 = await fileHandle.createSyncAccessHandle({mode: "in-place"});
9+
const syncHandle1 = await fileHandle.createSyncAccessHandle();
1010
await promise_rejects_dom(
11-
t, 'InvalidStateError', fileHandle.createSyncAccessHandle({mode: "in-place"}));
11+
t, 'InvalidStateError', fileHandle.createSyncAccessHandle());
1212

1313
await syncHandle1.close();
14-
const syncHandle2 = await fileHandle.createSyncAccessHandle({mode: "in-place"});
14+
const syncHandle2 = await fileHandle.createSyncAccessHandle();
1515
await syncHandle2.close();
1616
}, 'There can only be one open access handle at any given time');
1717

1818
directory_test(async (t, root_dir) => {
1919
const fooFileHandle = await root_dir.getFileHandle('foo.test', {create: true});
2020
const barFileHandle = await root_dir.getFileHandle('bar.test', {create: true});
2121

22-
const fooSyncHandle = await fooFileHandle.createSyncAccessHandle({mode: "in-place"});
22+
const fooSyncHandle = await fooFileHandle.createSyncAccessHandle();
2323
t.add_cleanup(() => fooSyncHandle.close());
2424

25-
const barSyncHandle1 = await barFileHandle.createSyncAccessHandle({mode: "in-place"});
25+
const barSyncHandle1 = await barFileHandle.createSyncAccessHandle();
2626
await promise_rejects_dom(
27-
t, 'InvalidStateError', barFileHandle.createSyncAccessHandle({mode: "in-place"}));
27+
t, 'InvalidStateError', barFileHandle.createSyncAccessHandle());
2828

2929
await barSyncHandle1.close();
30-
const barSyncHandle2 = await barFileHandle.createSyncAccessHandle({mode: "in-place"});
30+
const barSyncHandle2 = await barFileHandle.createSyncAccessHandle();
3131
await barSyncHandle2.close();
3232
}, 'An access handle from one file does not interfere with the creation of an' +
3333
' access handle on another file');
@@ -39,7 +39,7 @@ directory_test(async (t, root_dir) => {
3939
const fooWritable = await fooFileHandle.createWritable();
4040
t.add_cleanup(() => fooWritable.close());
4141

42-
const barSyncHandle = await barFileHandle.createSyncAccessHandle({mode: "in-place"});
42+
const barSyncHandle = await barFileHandle.createSyncAccessHandle();
4343
t.add_cleanup(() => barSyncHandle.close());
4444
}, 'A writable stream from one file does not interfere with the creation of an' +
4545
' access handle on another file');
@@ -48,7 +48,7 @@ directory_test(async (t, root_dir) => {
4848
const fooFileHandle = await root_dir.getFileHandle('foo.test', {create: true});
4949
const barFileHandle = await root_dir.getFileHandle('bar.test', {create: true});
5050

51-
const fooSyncHandle = await fooFileHandle.createSyncAccessHandle({mode: "in-place"});
51+
const fooSyncHandle = await fooFileHandle.createSyncAccessHandle();
5252
t.add_cleanup(() => fooSyncHandle.close());
5353

5454
const barWritable = await barFileHandle.createWritable();
@@ -59,7 +59,7 @@ directory_test(async (t, root_dir) => {
5959
directory_test(async (t, root_dir) => {
6060
const fileHandle = await root_dir.getFileHandle('OPFS.test', {create: true});
6161

62-
const syncHandle = await fileHandle.createSyncAccessHandle({mode: "in-place"});
62+
const syncHandle = await fileHandle.createSyncAccessHandle();
6363
await promise_rejects_dom(
6464
t, 'InvalidStateError', fileHandle.createWritable());
6565

@@ -74,14 +74,14 @@ directory_test(async (t, root_dir) => {
7474
const writable1 = await fileHandle.createWritable();
7575
const writable2 = await fileHandle.createWritable();
7676
await promise_rejects_dom(
77-
t, 'InvalidStateError', fileHandle.createSyncAccessHandle({mode: "in-place"}));
77+
t, 'InvalidStateError', fileHandle.createSyncAccessHandle());
7878

7979
await writable1.close();
8080
await promise_rejects_dom(
81-
t, 'InvalidStateError', fileHandle.createSyncAccessHandle({mode: "in-place"}));
81+
t, 'InvalidStateError', fileHandle.createSyncAccessHandle());
8282

8383
await writable2.close();
84-
const syncHandle = await fileHandle.createSyncAccessHandle({mode: "in-place"});
84+
const syncHandle = await fileHandle.createSyncAccessHandle();
8585
await syncHandle.close();
8686
}, 'Access handles cannot be created if there are open Writable streams');
8787

0 commit comments

Comments
 (0)