Skip to content

Commit

Permalink
Bug 1654380 [wpt PR 24688] - [NativeFS] Update permissions API follow…
Browse files Browse the repository at this point in the history
…ing spec change., a=testonly

Automatic update from web-platform-tests
[NativeFS] Update permissions API following spec change.

This implements the changes from WICG/file-system-access#200.

Change-Id: I9702f9888c4f0fff2084143ac6077b8484dfce16
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2298296
Reviewed-by: Trent Apted <taptedchromium.org>
Reviewed-by: Will Harris <wfhchromium.org>
Reviewed-by: Victor Costan <pwnallchromium.org>
Commit-Queue: Marijn Kruisselbrink <mekchromium.org>
Cr-Commit-Position: refs/heads/master{#792004}

--

wpt-commits: e85c3405f1269a2ca77ec9e4ea63a4df73ee754e
wpt-pr: 24688

UltraBlame original commit: 6e390caa95e19e686e5068f51f22537f3a1694b7
  • Loading branch information
marco-c committed Aug 3, 2020
1 parent 0f390fb commit d9a2da3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ async function serialize_handle(handle) {

async function serialize_file_system_handle(handle) {
const read_permission =
await handle.queryPermission({ writable: false });
await handle.queryPermission({ mode: 'read' });

const write_permission =
await handle.queryPermission({ writable: true })
await handle.queryPermission({ mode: 'readwrite' })

return {
kind: handle.kind,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ function directory_test(func, description) {
}

directory_test(async (t, dir) => {
assert_equals(await dir.queryPermission({writable: false}), 'granted');
assert_equals(await dir.queryPermission({mode: 'read'}), 'granted');
}, 'User succesfully selected an empty directory.');

directory_test(async (t, dir) => {
const status = await dir.queryPermission({writable: true});
const status = await dir.queryPermission({mode: 'readwrite'});
if (status == 'granted')
return;

await window.test_driver.bless('ask for write permission');
assert_equals(await dir.requestPermission({writable: true}), 'granted');
assert_equals(await dir.requestPermission({mode: 'readwrite'}), 'granted');
}, 'User granted write access.');
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

promise_test(async t => {
assert_equals(await file.queryPermission(), 'granted');
assert_equals(await file.queryPermission({ writable: true }), 'granted');
assert_equals(await file.queryPermission({ mode: 'readwrite' }), 'granted');
}, 'showSaveFilePicker returns correct permissions');
}, 'showSaveFilePicker works');

Expand Down

0 comments on commit d9a2da3

Please sign in to comment.