2011-04-20 Taiju TSUIKI <tzik@google.com>

        Reviewed by David Levin.

        Add overwrite copy/move tests for FileSystem API
        https://bugs.webkit.org/show_bug.cgi?id=58864

        * fast/filesystem/op-copy-expected.txt:
        * fast/filesystem/op-move-expected.txt:
        * fast/filesystem/resources/op-copy.js:
        * fast/filesystem/resources/op-move.js:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@84408 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a2e43098
2011-04-20 Taiju TSUIKI <tzik@google.com>
Reviewed by David Levin.
Add overwrite copy/move tests for FileSystem API
https://bugs.webkit.org/show_bug.cgi?id=58864
* fast/filesystem/op-copy-expected.txt:
* fast/filesystem/op-move-expected.txt:
* fast/filesystem/resources/op-copy.js:
* fast/filesystem/resources/op-move.js:
2011-04-20 Tony Chang <tony@chromium.org>
Unreviewed, embedding checksums in png files in platform/chromium-linux*.
......@@ -52,6 +52,35 @@ PASS Verified entry: ENTRY {path:/b/a name:a type:DIRECTORY}
PASS Verified entry: ENTRY {path:/b/a/b name:b type:DIRECTORY}
PASS Verified entry: ENTRY {path:/b/a/b/c name:c type:FILE}
PASS Verified entry: ENTRY {path:/b/a/b/d name:d type:FILE}
* Running: OverwritingCopyFileToFile
PASS Succeeded: "/a".copyTo("/", "b")
PASS Verified entry: ENTRY {path:/a name:a type:FILE}
PASS Verified entry: ENTRY {path:/b name:b type:FILE}
* Running: OverwritingCopyDirectoryToEmptyDirectory
PASS Succeeded: "/a".copyTo("/", "c")
PASS Verified entry: ENTRY {path:/a name:a type:DIRECTORY}
PASS Verified entry: ENTRY {path:/a/b name:b type:FILE}
PASS Verified entry: ENTRY {path:/c name:c type:DIRECTORY}
PASS Verified entry: ENTRY {path:/c/b name:b type:FILE}
* Running: OverwritingCopyFileToDirectory
PASS this.expectedErrorCode + "" is "9"
PASS Verified entry: ENTRY {path:/a name:a type:FILE}
PASS Verified entry: ENTRY {path:/b name:b type:DIRECTORY}
* Running: OverwritingCopyDirectoryToFile
PASS this.expectedErrorCode + "" is "9"
PASS Verified entry: ENTRY {path:/a name:a type:DIRECTORY}
PASS Verified entry: ENTRY {path:/b name:b type:FILE}
* Running: OverwritingCopyFileToNonemptyDirectory
PASS this.expectedErrorCode + "" is "9"
PASS Verified entry: ENTRY {path:/a name:a type:FILE}
PASS Verified entry: ENTRY {path:/b name:b type:DIRECTORY}
PASS Verified entry: ENTRY {path:/b/c name:c type:FILE}
* Running: OverwritingCopyDirectoryToNonemptyDirectory
PASS this.expectedErrorCode + "" is "9"
PASS Verified entry: ENTRY {path:/a name:a type:DIRECTORY}
PASS Verified entry: ENTRY {path:/a/b name:b type:FILE}
PASS Verified entry: ENTRY {path:/c name:c type:DIRECTORY}
PASS Verified entry: ENTRY {path:/c/d name:d type:FILE}
Finished running tests.
PASS successfullyParsed is true
......
......@@ -49,6 +49,33 @@ PASS Verified entry: ENTRY {path:/b/a name:a type:DIRECTORY}
PASS Verified entry: ENTRY {path:/b/a/b name:b type:DIRECTORY}
PASS Verified entry: ENTRY {path:/b/a/b/c name:c type:FILE}
PASS Verified entry: ENTRY {path:/b/a/b/d name:d type:FILE}
* Running: OverwritingMoveFileToFile
PASS Succeeded: "/a".moveTo("/", "b")
PASS Verified entry: ENTRY {path:/b name:b type:FILE}
* Running: OverwritingMoveDirectoryToEmptyDirectory
PASS Succeeded: "/a".moveTo("/", "c")
PASS Verified entry: ENTRY {path:/c name:c type:DIRECTORY}
PASS Verified entry: ENTRY {path:/c/b name:b type:FILE}
PASS Verified entry does NOT exist: /a
* Running: OverwritingMoveFileToDirectory
PASS this.expectedErrorCode + "" is "9"
PASS Verified entry: ENTRY {path:/a name:a type:FILE}
PASS Verified entry: ENTRY {path:/b name:b type:DIRECTORY}
* Running: OverwritingMoveDirectoryToFile
PASS this.expectedErrorCode + "" is "9"
PASS Verified entry: ENTRY {path:/a name:a type:DIRECTORY}
PASS Verified entry: ENTRY {path:/b name:b type:FILE}
* Running: OverwritingMoveFileToNonemptyDirectory
PASS this.expectedErrorCode + "" is "9"
PASS Verified entry: ENTRY {path:/a name:a type:FILE}
PASS Verified entry: ENTRY {path:/b name:b type:DIRECTORY}
PASS Verified entry: ENTRY {path:/b/c name:c type:FILE}
* Running: OverwritingMoveDirectoryToNonemptyDirectory
PASS this.expectedErrorCode + "" is "9"
PASS Verified entry: ENTRY {path:/a name:a type:DIRECTORY}
PASS Verified entry: ENTRY {path:/a/b name:b type:FILE}
PASS Verified entry: ENTRY {path:/c name:c type:DIRECTORY}
PASS Verified entry: ENTRY {path:/c/d name:d type:FILE}
Finished running tests.
PASS successfullyParsed is true
......
......@@ -161,4 +161,97 @@ var testCases = [
{fullPath:'/b/a/b/d'},
],
},
{
name: "OverwritingCopyFileToFile",
precondition: [
{fullPath:"/a"},
{fullPath:"/b"},
],
tests: [
function(helper) {helper.copy("/a","/","b");}
],
postcondition: [
{fullPath:"/a"},
{fullPath:"/b"},
],
},
{
name: "OverwritingCopyDirectoryToEmptyDirectory",
precondition: [
{fullPath:"/a", isDirectory:true},
{fullPath:"/a/b"},
{fullPath:"/c", isDirectory:true},
],
tests: [
function(helper) {helper.copy("/a","/","c");}
],
postcondition: [
{fullPath:"/a", isDirectory:true},
{fullPath:"/a/b"},
{fullPath:"/c", isDirectory:true},
{fullPath:"/c/b"},
],
},
{
name: "OverwritingCopyFileToDirectory",
precondition: [
{fullPath:"/a"},
{fullPath:"/b", isDirectory: true},
],
tests: [
function(helper) {helper.copy("/a","/","b",FileError.INVALID_MODIFICATION_ERR);}
],
postcondition: [
{fullPath:"/a"},
{fullPath:"/b", isDirectory: true},
],
},
{
name: "OverwritingCopyDirectoryToFile",
precondition: [
{fullPath:"/a", isDirectory: true},
{fullPath:"/b"},
],
tests: [
function(helper) {helper.copy("/a","/","b",FileError.INVALID_MODIFICATION_ERR);}
],
postcondition: [
{fullPath:"/a", isDirectory: true},
{fullPath:"/b"},
],
},
{
name: "OverwritingCopyFileToNonemptyDirectory",
precondition: [
{fullPath:"/a"},
{fullPath:"/b", isDirectory: true},
{fullPath:"/b/c"},
],
tests: [
function(helper) {helper.copy("/a","/","b",FileError.INVALID_MODIFICATION_ERR);}
],
postcondition: [
{fullPath:"/a"},
{fullPath:"/b", isDirectory: true},
{fullPath:"/b/c"},
],
},
{
name: "OverwritingCopyDirectoryToNonemptyDirectory",
precondition: [
{fullPath:"/a", isDirectory: true},
{fullPath:"/a/b"},
{fullPath:"/c", isDirectory: true},
{fullPath:"/c/d"},
],
tests: [
function(helper) {helper.copy("/a","/","c",FileError.INVALID_MODIFICATION_ERR);}
],
postcondition: [
{fullPath:"/a", isDirectory: true},
{fullPath:"/a/b"},
{fullPath:"/c", isDirectory: true},
{fullPath:"/c/d"},
],
},
];
......@@ -158,4 +158,95 @@ var testCases = [
{fullPath:'/b/a/b/d'},
],
},
{
name: "OverwritingMoveFileToFile",
precondition: [
{fullPath:"/a"},
{fullPath:"/b"},
],
tests: [
function(helper) {helper.move("/a","/","b");}
],
postcondition: [
{fullPath:"/b"},
],
},
{
name: "OverwritingMoveDirectoryToEmptyDirectory",
precondition: [
{fullPath:"/a", isDirectory:true},
{fullPath:"/a/b"},
{fullPath:"/c", isDirectory:true},
],
tests: [
function(helper) {helper.move("/a","/","c");}
],
postcondition: [
{fullPath:"/c", isDirectory:true},
{fullPath:"/c/b"},
{fullPath:"/a", nonexistent:true},
],
},
{
name: "OverwritingMoveFileToDirectory",
precondition: [
{fullPath:"/a"},
{fullPath:"/b", isDirectory: true},
],
tests: [
function(helper) {helper.move("/a","/","b",FileError.INVALID_MODIFICATION_ERR);}
],
postcondition: [
{fullPath:"/a"},
{fullPath:"/b", isDirectory: true},
],
},
{
name: "OverwritingMoveDirectoryToFile",
precondition: [
{fullPath:"/a", isDirectory: true},
{fullPath:"/b"},
],
tests: [
function(helper) {helper.move("/a","/","b",FileError.INVALID_MODIFICATION_ERR);}
],
postcondition: [
{fullPath:"/a", isDirectory: true},
{fullPath:"/b"},
],
},
{
name: "OverwritingMoveFileToNonemptyDirectory",
precondition: [
{fullPath:"/a"},
{fullPath:"/b", isDirectory: true},
{fullPath:"/b/c"},
],
tests: [
function(helper) {helper.move("/a","/","b",FileError.INVALID_MODIFICATION_ERR);}
],
postcondition: [
{fullPath:"/a"},
{fullPath:"/b", isDirectory: true},
{fullPath:"/b/c"},
],
},
{
name: "OverwritingMoveDirectoryToNonemptyDirectory",
precondition: [
{fullPath:"/a", isDirectory: true},
{fullPath:"/a/b"},
{fullPath:"/c", isDirectory: true},
{fullPath:"/c/d"},
],
tests: [
function(helper) {helper.move("/a","/","c",FileError.INVALID_MODIFICATION_ERR);}
],
postcondition: [
{fullPath:"/a", isDirectory: true},
{fullPath:"/a/b"},
{fullPath:"/c", isDirectory: true},
{fullPath:"/c/d"},
],
},
];
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment