diff --git a/content/browser/file_system_access/file_system_access_handle_base.cc b/content/browser/file_system_access/file_system_access_handle_base.cc index 1e5e4ba10e3882..c9b892db061163 100644 --- a/content/browser/file_system_access/file_system_access_handle_base.cc +++ b/content/browser/file_system_access/file_system_access_handle_base.cc @@ -32,9 +32,13 @@ #include "third_party/blink/public/mojom/file_system_access/file_system_access_error.mojom-forward.h" namespace features { +// TODO(crbug.com/1381621): This feature was disabled since it does not match +// standard POSIX behavior. We should explore adding a flag to allow opting in +// to overwriting moves. See discussion at +// https://github.com/whatwg/fs/pull/10#issuecomment-1322993643. BASE_FEATURE(kFileSystemAccessDoNotOverwriteOnMove, "FileSystemAccessDoNotOverwriteOnMove", - base::FEATURE_ENABLED_BY_DEFAULT); + base::FEATURE_DISABLED_BY_DEFAULT); } // namespace features namespace content { diff --git a/content/browser/file_system_access/file_system_access_handle_base.h b/content/browser/file_system_access/file_system_access_handle_base.h index cee1cb4503dd33..7ff6d3c5689f76 100644 --- a/content/browser/file_system_access/file_system_access_handle_base.h +++ b/content/browser/file_system_access/file_system_access_handle_base.h @@ -19,7 +19,7 @@ #include "third_party/blink/public/mojom/permissions/permission_status.mojom.h" namespace features { -// TODO(crbug.com/1366652): Remove this flag eventually. +// TODO(crbug.com/1381621): Remove this flag eventually. // When enabled, move() will result in a promise rejection when the specified // destination to move to exists. BASE_DECLARE_FEATURE(kFileSystemAccessDoNotOverwriteOnMove); diff --git a/third_party/blink/web_tests/external/wpt/fs/FileSystemFileHandle-move.https.any-expected.txt b/third_party/blink/web_tests/external/wpt/fs/FileSystemFileHandle-move.https.any-expected.txt new file mode 100644 index 00000000000000..891983b2b381cd --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/fs/FileSystemFileHandle-move.https.any-expected.txt @@ -0,0 +1,24 @@ +This is a testharness.js-based test. +PASS move(name) to rename a file +PASS get a handle to a moved file +PASS move(name) to rename a file the same name +PASS move("") to rename a file fails +PASS move(name) can be called multiple times +PASS move(name) with a name with a trailing period should fail +PASS move(name) with a name with invalid characters should fail +PASS move(name) while the file has an open writable fails +FAIL move(name) while the destination file has an open writable fails assert_unreached: Should have rejected: undefined Reached unreachable code +PASS move(dir, name) to rename a file +PASS move(dir, name) to rename a file the same name +PASS move(dir) to move a file to a new directory +PASS move(dir, "") to move a file to a new directory fails +PASS move(dir, name) to move a file to a new directory +PASS move(dir) can be called multiple times +PASS move(dir, name) can be called multiple times +PASS move(dir, name) with a name with invalid characters should fail +PASS move(dir) while the file has an open writable fails +PASS move(dir, name) while the file has an open writable fails +FAIL move(dir) while the destination file has an open writable fails assert_unreached: Should have rejected: undefined Reached unreachable code +FAIL move(dir, name) while the destination file has an open writable fails assert_unreached: Should have rejected: undefined Reached unreachable code +Harness: the test ran to completion. + diff --git a/third_party/blink/web_tests/external/wpt/fs/FileSystemFileHandle-move.https.any.worker-expected.txt b/third_party/blink/web_tests/external/wpt/fs/FileSystemFileHandle-move.https.any.worker-expected.txt new file mode 100644 index 00000000000000..891983b2b381cd --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/fs/FileSystemFileHandle-move.https.any.worker-expected.txt @@ -0,0 +1,24 @@ +This is a testharness.js-based test. +PASS move(name) to rename a file +PASS get a handle to a moved file +PASS move(name) to rename a file the same name +PASS move("") to rename a file fails +PASS move(name) can be called multiple times +PASS move(name) with a name with a trailing period should fail +PASS move(name) with a name with invalid characters should fail +PASS move(name) while the file has an open writable fails +FAIL move(name) while the destination file has an open writable fails assert_unreached: Should have rejected: undefined Reached unreachable code +PASS move(dir, name) to rename a file +PASS move(dir, name) to rename a file the same name +PASS move(dir) to move a file to a new directory +PASS move(dir, "") to move a file to a new directory fails +PASS move(dir, name) to move a file to a new directory +PASS move(dir) can be called multiple times +PASS move(dir, name) can be called multiple times +PASS move(dir, name) with a name with invalid characters should fail +PASS move(dir) while the file has an open writable fails +PASS move(dir, name) while the file has an open writable fails +FAIL move(dir) while the destination file has an open writable fails assert_unreached: Should have rejected: undefined Reached unreachable code +FAIL move(dir, name) while the destination file has an open writable fails assert_unreached: Should have rejected: undefined Reached unreachable code +Harness: the test ran to completion. +