From 3bc2422174488e776f1c2b349078f81b8fb7b495 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Mon, 30 Oct 2023 11:05:46 +0000 Subject: [PATCH] Bug 1830580 [wpt PR 39755] - FSA: Relax file name checks in the BucketFS, a=testonly Automatic update from web-platform-tests FSA: Relax file name checks in the BucketFS 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 https://github.com/whatwg/fs/issues/93 for context Bug: 1399536 Change-Id: I019b393b731cd20aa4c45eade4eca19b6633e9cd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4492076 Reviewed-by: Daseul Lee Commit-Queue: Austin Sullivan Cr-Commit-Position: refs/heads/main{#1206676} -- wpt-commits: e4c1bdf27a01716a605a70e171be797f560952bf wpt-pr: 39755 UltraBlame original commit: 364abd441d742e0bc35abe26540b3d46125d8752 --- .../tests/fs/resources/test-helpers.js | 29 ---- .../script-tests/FileSystemFileHandle-move.js | 129 +----------------- 2 files changed, 7 insertions(+), 151 deletions(-) diff --git a/testing/web-platform/tests/fs/resources/test-helpers.js b/testing/web-platform/tests/fs/resources/test-helpers.js index cc29587c1f56e..c8d5ae6867529 100644 --- a/testing/web-platform/tests/fs/resources/test-helpers.js +++ b/testing/web-platform/tests/fs/resources/test-helpers.js @@ -62,23 +62,6 @@ exclusive ; let kPathSeparators -; -if -( -navigator -. -userAgent -. -includes -( -' -Windows -NT -' -) -) -{ -kPathSeparators = [ ' @@ -90,18 +73,6 @@ kPathSeparators ' ] ; -} -else -{ -kPathSeparators -= -[ -' -/ -' -] -; -} async function getFileSize diff --git a/testing/web-platform/tests/fs/script-tests/FileSystemFileHandle-move.js b/testing/web-platform/tests/fs/script-tests/FileSystemFileHandle-move.js index c7cdbc6a49d54..d184964455848 100644 --- a/testing/web-platform/tests/fs/script-tests/FileSystemFileHandle-move.js +++ b/testing/web-platform/tests/fs/script-tests/FileSystemFileHandle-move.js @@ -509,24 +509,6 @@ root > { const -dir -= -await -root -. -getDirectoryHandle -( -' -dir -' -{ -create -: -true -} -) -; -const handle = await @@ -541,7 +523,7 @@ before ' foo ' -dir +root ) ; await @@ -554,109 +536,11 @@ handle move ( ' -Lorem -. -' -) -) -; -assert_array_equals -( -await -getSortedDirectoryEntries -( -root -) -[ -' -dir +test / +test ' -] -) -; -assert_array_equals -( -await -getSortedDirectoryEntries -( -dir -) -[ -' -file -- -before -' -] -) -; -assert_equals -( -await -getFileContents -( -handle -) -' -foo -' -) -; -assert_equals -( -await -getFileSize -( -handle -) -3 -) -; -} -' -move -( -name ) -with -a -name -with -a -trailing -period -should -fail -' -) -; -directory_test -( -async -( -t -root -) -= -> -{ -const -handle -= -await -createFileWithContents -( -t -' -file -- -before -' -' -foo -' -root ) ; await @@ -670,7 +554,8 @@ move ( ' test -/ +\ +\ test ' ) @@ -724,8 +609,8 @@ with a name with -invalid -characters +path +separators should fail '