Skip to content

Commit

Permalink
FSA: Relax file name checks in the BucketFS
Browse files Browse the repository at this point in the history
Unlike when saving files to the local file system, the names of files in
the the Bucket File System (a.k.a. OPFS) are obfuscated before they end
up on disk - if they even end up on disk at all.

As such, we don't need to perform the same name sanitization and
obfuscation for these files as we do for files that end up on the
user-visible file system.

See whatwg/fs#93 for context

Bug: 1399536
Change-Id: I019b393b731cd20aa4c45eade4eca19b6633e9cd
  • Loading branch information
a-sully authored and chromium-wpt-export-bot committed Apr 28, 2023
1 parent d9f5e1f commit 9cd3c9d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions fs/resources/test-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ const kCurrentDirectory = '.';
const kParentDirectory = '..';

// Array of separators used to separate components in hierarchical paths.
let kPathSeparators;
if (navigator.userAgent.includes('Windows NT')) {
// Windows uses both '/' and '\' as path separators.
kPathSeparators = ['/', '\\'];
} else {
kPathSeparators = ['/'];
}
// Consider both '/' and '\' as path separators to ensure file names are
// platform-agnostic.
let kPathSeparators = ['/', '\\'];

async function getFileSize(handle) {
const file = await handle.getFile();
Expand Down

0 comments on commit 9cd3c9d

Please sign in to comment.