OLD | NEW |
1 var testCases = [ | 1 var testCases = [ |
2 { | 2 { |
3 name: 'CopyFileSimple', | 3 name: 'CopyFileSimple', |
4 precondition: [ | 4 precondition: [ |
5 {fullPath:'/a', isDirectory:true}, | 5 {fullPath:'/a', isDirectory:true}, |
6 {fullPath:'/a/b'} | 6 {fullPath:'/a/b'} |
7 ], | 7 ], |
8 tests: [ | 8 tests: [ |
9 function(helper) { helper.copy('/a/b', '/a', 'c'); } | 9 function(helper) { helper.copy('/a/b', '/a', 'c'); } |
10 ], | 10 ], |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 {fullPath:'/c/b'} | 61 {fullPath:'/c/b'} |
62 ], | 62 ], |
63 }, | 63 }, |
64 { | 64 { |
65 name: 'CopyFileWithEmptyNameToSameDirectory', | 65 name: 'CopyFileWithEmptyNameToSameDirectory', |
66 precondition: [ | 66 precondition: [ |
67 {fullPath:'/a', isDirectory:true}, | 67 {fullPath:'/a', isDirectory:true}, |
68 {fullPath:'/a/b'}, | 68 {fullPath:'/a/b'}, |
69 ], | 69 ], |
70 tests: [ | 70 tests: [ |
71 function(helper) { helper.copy('/a/b', '/a', null, FileError.INVALID
_MODIFICATION_ERR); }, | 71 function(helper) { helper.copy('/a/b', '/a', null, 'InvalidModificat
ionError'); }, |
72 ], | 72 ], |
73 postcondition: [ | 73 postcondition: [ |
74 {fullPath:'/a', isDirectory:true}, | 74 {fullPath:'/a', isDirectory:true}, |
75 {fullPath:'/a/b'}, | 75 {fullPath:'/a/b'}, |
76 ], | 76 ], |
77 }, | 77 }, |
78 { | 78 { |
79 name: 'CopyFileWithSameName', | 79 name: 'CopyFileWithSameName', |
80 precondition: [ | 80 precondition: [ |
81 {fullPath:'/a', isDirectory:true}, | 81 {fullPath:'/a', isDirectory:true}, |
82 {fullPath:'/a/b'}, | 82 {fullPath:'/a/b'}, |
83 ], | 83 ], |
84 tests: [ | 84 tests: [ |
85 function(helper) { helper.copy('/a/b', '/a', 'b', FileError.INVALID_
MODIFICATION_ERR); }, | 85 function(helper) { helper.copy('/a/b', '/a', 'b', 'InvalidModificati
onError'); }, |
86 ], | 86 ], |
87 postcondition: [ | 87 postcondition: [ |
88 {fullPath:'/a', isDirectory:true}, | 88 {fullPath:'/a', isDirectory:true}, |
89 {fullPath:'/a/b'}, | 89 {fullPath:'/a/b'}, |
90 ], | 90 ], |
91 }, | 91 }, |
92 { | 92 { |
93 name: 'CopyForNonExistentEntry', | 93 name: 'CopyForNonExistentEntry', |
94 precondition: [ | 94 precondition: [ |
95 {fullPath:'/a', isDirectory:true}, | 95 {fullPath:'/a', isDirectory:true}, |
96 {fullPath:'/a/b'}, | 96 {fullPath:'/a/b'}, |
97 {fullPath:'/c', isDirectory:true}, | 97 {fullPath:'/c', isDirectory:true}, |
98 ], | 98 ], |
99 tests: [ | 99 tests: [ |
100 function(helper) { helper.remove('/a/b'); }, | 100 function(helper) { helper.remove('/a/b'); }, |
101 function(helper) { helper.copy('/a/b', '/c', 'b', FileError.NOT_FOUN
D_ERR); }, | 101 function(helper) { helper.copy('/a/b', '/c', 'b', 'NotFoundError');
}, |
102 ], | 102 ], |
103 postcondition: [ | 103 postcondition: [ |
104 {fullPath:'/a', isDirectory:true}, | 104 {fullPath:'/a', isDirectory:true}, |
105 {fullPath:'/c', isDirectory:true}, | 105 {fullPath:'/c', isDirectory:true}, |
106 ], | 106 ], |
107 }, | 107 }, |
108 { | 108 { |
109 name: 'CopyEntryToNonExistentDirectory', | 109 name: 'CopyEntryToNonExistentDirectory', |
110 precondition: [ | 110 precondition: [ |
111 {fullPath:'/a', isDirectory:true}, | 111 {fullPath:'/a', isDirectory:true}, |
112 {fullPath:'/a/b'}, | 112 {fullPath:'/a/b'}, |
113 {fullPath:'/c', isDirectory:true}, | 113 {fullPath:'/c', isDirectory:true}, |
114 ], | 114 ], |
115 tests: [ | 115 tests: [ |
116 function(helper) { helper.remove('/c'); }, | 116 function(helper) { helper.remove('/c'); }, |
117 function(helper) { helper.copy('/a/b', '/c', 'b', FileError.NOT_FOUN
D_ERR); }, | 117 function(helper) { helper.copy('/a/b', '/c', 'b', 'NotFoundError');
}, |
118 ], | 118 ], |
119 postcondition: [ | 119 postcondition: [ |
120 {fullPath:'/a', isDirectory:true}, | 120 {fullPath:'/a', isDirectory:true}, |
121 {fullPath:'/a/b'}, | 121 {fullPath:'/a/b'}, |
122 ], | 122 ], |
123 }, | 123 }, |
124 { | 124 { |
125 name: 'CopyEntryToItsChild', | 125 name: 'CopyEntryToItsChild', |
126 precondition: [ | 126 precondition: [ |
127 {fullPath:'/a', isDirectory:true}, | 127 {fullPath:'/a', isDirectory:true}, |
128 {fullPath:'/a/b', isDirectory:true}, | 128 {fullPath:'/a/b', isDirectory:true}, |
129 {fullPath:'/a/b/c', isDirectory:true}, | 129 {fullPath:'/a/b/c', isDirectory:true}, |
130 ], | 130 ], |
131 tests: [ | 131 tests: [ |
132 function(helper) { helper.copy('/a', '/a/b', 'd', FileError.INVALID_
MODIFICATION_ERR); }, | 132 function(helper) { helper.copy('/a', '/a/b', 'd', 'InvalidModificati
onError'); }, |
133 function(helper) { helper.copy('/a/b', '/a/b/c', 'd', FileError.INVA
LID_MODIFICATION_ERR); }, | 133 function(helper) { helper.copy('/a/b', '/a/b/c', 'd', 'InvalidModifi
cationError'); }, |
134 ], | 134 ], |
135 postcondition: [ | 135 postcondition: [ |
136 {fullPath:'/a', isDirectory:true}, | 136 {fullPath:'/a', isDirectory:true}, |
137 {fullPath:'/a/b', isDirectory:true}, | 137 {fullPath:'/a/b', isDirectory:true}, |
138 {fullPath:'/a/b/c', isDirectory:true}, | 138 {fullPath:'/a/b/c', isDirectory:true}, |
139 ], | 139 ], |
140 }, | 140 }, |
141 { | 141 { |
142 name: 'CopyRecursive', | 142 name: 'CopyRecursive', |
143 precondition: [ | 143 precondition: [ |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 {fullPath:"/c/b"}, | 192 {fullPath:"/c/b"}, |
193 ], | 193 ], |
194 }, | 194 }, |
195 { | 195 { |
196 name: "OverwritingCopyFileToDirectory", | 196 name: "OverwritingCopyFileToDirectory", |
197 precondition: [ | 197 precondition: [ |
198 {fullPath:"/a"}, | 198 {fullPath:"/a"}, |
199 {fullPath:"/b", isDirectory: true}, | 199 {fullPath:"/b", isDirectory: true}, |
200 ], | 200 ], |
201 tests: [ | 201 tests: [ |
202 function(helper) {helper.copy("/a","/","b",FileError.INVALID_MODIFIC
ATION_ERR);} | 202 function(helper) {helper.copy("/a","/","b",'InvalidModificationError
');} |
203 ], | 203 ], |
204 postcondition: [ | 204 postcondition: [ |
205 {fullPath:"/a"}, | 205 {fullPath:"/a"}, |
206 {fullPath:"/b", isDirectory: true}, | 206 {fullPath:"/b", isDirectory: true}, |
207 ], | 207 ], |
208 }, | 208 }, |
209 { | 209 { |
210 name: "OverwritingCopyDirectoryToFile", | 210 name: "OverwritingCopyDirectoryToFile", |
211 precondition: [ | 211 precondition: [ |
212 {fullPath:"/a", isDirectory: true}, | 212 {fullPath:"/a", isDirectory: true}, |
213 {fullPath:"/b"}, | 213 {fullPath:"/b"}, |
214 ], | 214 ], |
215 tests: [ | 215 tests: [ |
216 function(helper) {helper.copy("/a","/","b",FileError.INVALID_MODIFIC
ATION_ERR);} | 216 function(helper) {helper.copy("/a","/","b",'InvalidModificationError
');} |
217 ], | 217 ], |
218 postcondition: [ | 218 postcondition: [ |
219 {fullPath:"/a", isDirectory: true}, | 219 {fullPath:"/a", isDirectory: true}, |
220 {fullPath:"/b"}, | 220 {fullPath:"/b"}, |
221 ], | 221 ], |
222 }, | 222 }, |
223 { | 223 { |
224 name: "OverwritingCopyFileToNonemptyDirectory", | 224 name: "OverwritingCopyFileToNonemptyDirectory", |
225 precondition: [ | 225 precondition: [ |
226 {fullPath:"/a"}, | 226 {fullPath:"/a"}, |
227 {fullPath:"/b", isDirectory: true}, | 227 {fullPath:"/b", isDirectory: true}, |
228 {fullPath:"/b/c"}, | 228 {fullPath:"/b/c"}, |
229 ], | 229 ], |
230 tests: [ | 230 tests: [ |
231 function(helper) {helper.copy("/a","/","b",FileError.INVALID_MODIFIC
ATION_ERR);} | 231 function(helper) {helper.copy("/a","/","b",'InvalidModificationError
');} |
232 ], | 232 ], |
233 postcondition: [ | 233 postcondition: [ |
234 {fullPath:"/a"}, | 234 {fullPath:"/a"}, |
235 {fullPath:"/b", isDirectory: true}, | 235 {fullPath:"/b", isDirectory: true}, |
236 {fullPath:"/b/c"}, | 236 {fullPath:"/b/c"}, |
237 ], | 237 ], |
238 }, | 238 }, |
239 { | 239 { |
240 name: "OverwritingCopyDirectoryToNonemptyDirectory", | 240 name: "OverwritingCopyDirectoryToNonemptyDirectory", |
241 precondition: [ | 241 precondition: [ |
242 {fullPath:"/a", isDirectory: true}, | 242 {fullPath:"/a", isDirectory: true}, |
243 {fullPath:"/a/b"}, | 243 {fullPath:"/a/b"}, |
244 {fullPath:"/c", isDirectory: true}, | 244 {fullPath:"/c", isDirectory: true}, |
245 {fullPath:"/c/d"}, | 245 {fullPath:"/c/d"}, |
246 ], | 246 ], |
247 tests: [ | 247 tests: [ |
248 function(helper) {helper.copy("/a","/","c",FileError.INVALID_MODIFIC
ATION_ERR);} | 248 function(helper) {helper.copy("/a","/","c",'InvalidModificationError
');} |
249 ], | 249 ], |
250 postcondition: [ | 250 postcondition: [ |
251 {fullPath:"/a", isDirectory: true}, | 251 {fullPath:"/a", isDirectory: true}, |
252 {fullPath:"/a/b"}, | 252 {fullPath:"/a/b"}, |
253 {fullPath:"/c", isDirectory: true}, | 253 {fullPath:"/c", isDirectory: true}, |
254 {fullPath:"/c/d"}, | 254 {fullPath:"/c/d"}, |
255 ], | 255 ], |
256 }, | 256 }, |
257 ]; | 257 ]; |
OLD | NEW |