Add overwrite copy/move tests for FileSystem API. Currently, layout tests in fast/filesystem for copy/move don't have overwriting test. Spec says: > A move of a file on top of an existing file must attempt to delete and replace that file. > A move of a directory on top of an existing empty directory must attempt to delete and replace that directory. http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#widl-EntrySync-moveTo
Created attachment 90151 [details] Patch
(In reply to comment #0) > Add overwrite copy/move tests for FileSystem API. > Currently, layout tests in fast/filesystem for copy/move don't have overwriting test. > > Spec says: > > A move of a file on top of an existing file must attempt to delete and replace that file. > > A move of a directory on top of an existing empty directory must attempt to delete and replace that directory. > http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#widl-EntrySync-moveTo It looks like the spec doesn't explicitly say which error code should be returned when an attempt to copy/move a file on top of a directory is made, and seems like we're returning TYPE_MISMATCH_ERR. Eric, do you have any idea which error code should be returned in this case? Maybe INVALID_MODIFICATION_ERR is the right one?
(In reply to comment #2) > (In reply to comment #0) > > Add overwrite copy/move tests for FileSystem API. > > Currently, layout tests in fast/filesystem for copy/move don't have overwriting test. > > > > Spec says: > > > A move of a file on top of an existing file must attempt to delete and replace that file. > > > A move of a directory on top of an existing empty directory must attempt to delete and replace that directory. > > http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#widl-EntrySync-moveTo > > It looks like the spec doesn't explicitly say which error code should be returned when an attempt to copy/move a file on top of a directory is made, and seems like we're returning TYPE_MISMATCH_ERR. > > Eric, do you have any idea which error code should be returned in this case? > Maybe INVALID_MODIFICATION_ERR is the right one? TYPE_MISMATCH_ERR would be OK if the directory to be overwritten was empty, and failed because you were moving a file there. However, if you were moving a directory on top of a non-empty directory, INVALID_MODIFICATION_ERR is correct. Let's just make it INVALID_MODIFICATION_ERR for all of them for simplicity, and I'll fix the spec.
Created attachment 90324 [details] Patch
The patch looks good to me. Thanks!
Comment on attachment 90324 [details] Patch Clearing flags on attachment: 90324 Committed r84408: <http://trac.webkit.org/changeset/84408>
All reviewed patches have been landed. Closing bug.