Skip to content

Commit

Permalink
Bug 1793524 [wpt PR 36170] - Remove queryPermission() usage from wpt/…
Browse files Browse the repository at this point in the history
…fs helper function., a=testonly

Automatic update from web-platform-tests
Remove queryPermission() usage from wpt/fs helper function.

Permission is not required in OPFS.
whatwg/fs#42

Bug: 1362626
Change-Id: I2c75c0374c9f5a9c323a03950f7bd3bdd4a93750
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3923838
Commit-Queue: Daseul Lee <dslee@chromium.org>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1054413}

--

wpt-commits: 9903e1acb8d6215c058f36523d936fa6f5487796
wpt-pr: 36170
  • Loading branch information
dslee414 authored and moz-wptsync-bot committed Oct 21, 2022
1 parent f628bee commit dac2f4e
Showing 1 changed file with 3 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,9 @@ async function serialize_handle(handle) {
// serialized properties shared by both FileSystemFileHandle and
// FileSystemDirectoryHandle.
async function serialize_file_system_handle(handle) {
let read_permission = "granted";
let write_permission = "granted";
// query-permission is part of the File System Acecss API
// https://wicg.github.io/file-system-access, which may not be supported
if ("queryPermission" in FileSystemHandle.prototype) {
read_permission =
await handle.queryPermission({ mode: 'read' });

write_permission =
await handle.queryPermission({ mode: 'readwrite' })
}
return {
kind: handle.kind,
name: handle.name,
read_permission,
write_permission
name: handle.name
};
}

Expand All @@ -54,9 +41,7 @@ async function serialize_file_system_handle(handle) {
// dictionary. Example output:
// {
// kind: "file",
// name: "example-file-name"
// read_permission: "granted",
// write_permission: "granted",
// name: "example-file-name",
// contents: "example-file-contents"
// }
async function serialize_file_system_file_handle(file_handle) {
Expand All @@ -72,9 +57,7 @@ async function serialize_file_system_file_handle(file_handle) {
// Example output:
// {
// kind: "directory",
// name: "example-directory-name"
// read_permission: "granted",
// write_permission: "granted",
// name: "example-directory-name",
// files: [<first serialized file>, ...]
// directories: [<first serialized subdirectory>, ...]
// }
Expand Down Expand Up @@ -161,14 +144,6 @@ function assert_equals_serialized_file_system_handle(left, right) {
assert_equals(left.name, right.name,
'Each FileSystemHandle instance must use the expected "name" ' +
' property.');

assert_equals(left.read_permission, right.read_permission,
'Each FileSystemHandle instance must have the expected read ' +
' permission.');

assert_equals(left.write_permission, right.write_permission,
'Each FileSystemHandle instance must have the expected write ' +
' permission.');
}

// Compares the output of serialize_file_system_file_handle()
Expand Down

0 comments on commit dac2f4e

Please sign in to comment.