RESOLVED FIXED 58864
Add overwrite copy/move tests for FileSystem API
https://bugs.webkit.org/show_bug.cgi?id=58864
Summary Add overwrite copy/move tests for FileSystem API
Taiju Tsuiki
Reported 2011-04-18 21:58:54 PDT
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
Attachments
Patch (8.55 KB, patch)
2011-04-18 23:29 PDT, Taiju Tsuiki
no flags
Patch (11.07 KB, patch)
2011-04-20 02:17 PDT, Taiju Tsuiki
no flags
Taiju Tsuiki
Comment 1 2011-04-18 23:29:46 PDT
Kinuko Yasuda
Comment 2 2011-04-19 07:15:34 PDT
(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?
Eric U.
Comment 3 2011-04-19 15:05:42 PDT
(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.
Taiju Tsuiki
Comment 4 2011-04-20 02:17:19 PDT
Kinuko Yasuda
Comment 5 2011-04-20 04:46:07 PDT
The patch looks good to me. Thanks!
WebKit Commit Bot
Comment 6 2011-04-20 12:54:23 PDT
Comment on attachment 90324 [details] Patch Clearing flags on attachment: 90324 Committed r84408: <http://trac.webkit.org/changeset/84408>
WebKit Commit Bot
Comment 7 2011-04-20 12:54:28 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.