Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test requestPermission() and FileSystemHandlePermissionDescriptor [Native File System] #21177

Open
guest271314 opened this issue Jan 14, 2020 · 1 comment

Comments

@guest271314
Copy link
Contributor

Native File System (Draft Community Group Report, 18 November 2019)

Includes descriptions of requestPermission() and option descriptor = {}. However, implementation at Chromium 81 does not appear to perform any check for type or value of descriptor

In pertinent part 2.2. The FileSystemHandle interface

dictionary FileSystemHandlePermissionDescriptor {
  boolean writable = false;
};
 Promise<PermissionState> requestPermission(optional FileSystemHandlePermissionDescriptor descriptor = {});

and 2.2.2. The requestPermission() method

status = await handle . requestPermission({ writable = false })
status = await handle . requestPermission({ writable = true })

Context

While testing two branches of code that composed which uses Native File System noticed that in one branch had written {writable:true} while in the other branch had written {write:true}, checked the specification for which was expected, the output had no observable difference, continued checking other inputs, output.

Following

const dir = await self.chooseFileSystemEntries({type: "openDirectory"})

the result of

  1. const status = await dir.requestPermission()
  2. const status = await dir.requestPermission({write: true})
  3. const status = await dir.requestPermission({[void 0]: true})
  4. const status = await dir.requestPermission(void 0)
  5. const status = await dir.requestPermission({writable: false})

are identical, that is, "granted", meaning descriptor does not have any effect on the output of requestPermission() in any case.

It is not immediately clear what the purpose of descriptor is, nor what algorithm, if any, is applicable to the optional value passed (https://bugs.chromium.org/p/chromium/issues/detail?id=1042018).

It is clear that list items, 2., 3., 4. are not expected values of descriptor per the current iteration of the Native File System draft.

@guest271314
Copy link
Contributor Author

This pattern

status = await dir.requestPermission({descriptor:{[void 0]: false}});

does have any noticable difference as to output either.

@Hexcles Hexcles changed the title Test requestPermission() and FileSystemHandlePermissionDescriptor [Native File System][Missing Coverage] Test requestPermission() and FileSystemHandlePermissionDescriptor [Native File System] Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants