OLD | NEW |
1 var testCases = [ | 1 var testCases = [ |
2 { | 2 { |
3 name: 'MoveFileSimple', | 3 name: 'MoveFileSimple', |
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.move('/a/b', '/a', 'c'); } | 9 function(helper) { helper.move('/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: 'MoveFileWithEmptyNameToSameDirectory', | 65 name: 'MoveFileWithEmptyNameToSameDirectory', |
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.move('/a/b', '/a', null, FileError.INVALID
_MODIFICATION_ERR); }, | 71 function(helper) { helper.move('/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: 'MoveFileWithSameName', | 79 name: 'MoveFileWithSameName', |
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.move('/a/b', '/a', 'b', FileError.INVALID_
MODIFICATION_ERR); }, | 85 function(helper) { helper.move('/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: 'MoveForNonExistentEntry', | 93 name: 'MoveForNonExistentEntry', |
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.move('/a/b', '/c', 'b', FileError.NOT_FOUN
D_ERR); }, | 101 function(helper) { helper.move('/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: 'MoveEntryToNonExistentDirectory', | 109 name: 'MoveEntryToNonExistentDirectory', |
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.move('/a/b', '/c', 'b', FileError.NOT_FOUN
D_ERR); }, | 117 function(helper) { helper.move('/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: 'MoveEntryToItsChild', | 125 name: 'MoveEntryToItsChild', |
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.move('/a', '/a/b', 'd', FileError.INVALID_
MODIFICATION_ERR); }, | 132 function(helper) { helper.move('/a', '/a/b', 'd', 'InvalidModificati
onError'); }, |
133 function(helper) { helper.move('/a/b', '/a/b/c', 'd', FileError.INVA
LID_MODIFICATION_ERR); }, | 133 function(helper) { helper.move('/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: 'MoveRecursive', | 142 name: 'MoveRecursive', |
143 precondition: [ | 143 precondition: [ |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 {fullPath:"/a", nonexistent:true}, | 187 {fullPath:"/a", nonexistent:true}, |
188 ], | 188 ], |
189 }, | 189 }, |
190 { | 190 { |
191 name: "OverwritingMoveFileToDirectory", | 191 name: "OverwritingMoveFileToDirectory", |
192 precondition: [ | 192 precondition: [ |
193 {fullPath:"/a"}, | 193 {fullPath:"/a"}, |
194 {fullPath:"/b", isDirectory: true}, | 194 {fullPath:"/b", isDirectory: true}, |
195 ], | 195 ], |
196 tests: [ | 196 tests: [ |
197 function(helper) {helper.move("/a","/","b",FileError.INVALID_MODIFIC
ATION_ERR);} | 197 function(helper) {helper.move("/a","/","b",'InvalidModificationError
');} |
198 ], | 198 ], |
199 postcondition: [ | 199 postcondition: [ |
200 {fullPath:"/a"}, | 200 {fullPath:"/a"}, |
201 {fullPath:"/b", isDirectory: true}, | 201 {fullPath:"/b", isDirectory: true}, |
202 ], | 202 ], |
203 }, | 203 }, |
204 { | 204 { |
205 name: "OverwritingMoveDirectoryToFile", | 205 name: "OverwritingMoveDirectoryToFile", |
206 precondition: [ | 206 precondition: [ |
207 {fullPath:"/a", isDirectory: true}, | 207 {fullPath:"/a", isDirectory: true}, |
208 {fullPath:"/b"}, | 208 {fullPath:"/b"}, |
209 ], | 209 ], |
210 tests: [ | 210 tests: [ |
211 function(helper) {helper.move("/a","/","b",FileError.INVALID_MODIFIC
ATION_ERR);} | 211 function(helper) {helper.move("/a","/","b",'InvalidModificationError
');} |
212 ], | 212 ], |
213 postcondition: [ | 213 postcondition: [ |
214 {fullPath:"/a", isDirectory: true}, | 214 {fullPath:"/a", isDirectory: true}, |
215 {fullPath:"/b"}, | 215 {fullPath:"/b"}, |
216 ], | 216 ], |
217 }, | 217 }, |
218 { | 218 { |
219 name: "OverwritingMoveFileToNonemptyDirectory", | 219 name: "OverwritingMoveFileToNonemptyDirectory", |
220 precondition: [ | 220 precondition: [ |
221 {fullPath:"/a"}, | 221 {fullPath:"/a"}, |
222 {fullPath:"/b", isDirectory: true}, | 222 {fullPath:"/b", isDirectory: true}, |
223 {fullPath:"/b/c"}, | 223 {fullPath:"/b/c"}, |
224 ], | 224 ], |
225 tests: [ | 225 tests: [ |
226 function(helper) {helper.move("/a","/","b",FileError.INVALID_MODIFIC
ATION_ERR);} | 226 function(helper) {helper.move("/a","/","b",'InvalidModificationError
');} |
227 ], | 227 ], |
228 postcondition: [ | 228 postcondition: [ |
229 {fullPath:"/a"}, | 229 {fullPath:"/a"}, |
230 {fullPath:"/b", isDirectory: true}, | 230 {fullPath:"/b", isDirectory: true}, |
231 {fullPath:"/b/c"}, | 231 {fullPath:"/b/c"}, |
232 ], | 232 ], |
233 }, | 233 }, |
234 { | 234 { |
235 name: "OverwritingMoveDirectoryToNonemptyDirectory", | 235 name: "OverwritingMoveDirectoryToNonemptyDirectory", |
236 precondition: [ | 236 precondition: [ |
237 {fullPath:"/a", isDirectory: true}, | 237 {fullPath:"/a", isDirectory: true}, |
238 {fullPath:"/a/b"}, | 238 {fullPath:"/a/b"}, |
239 {fullPath:"/c", isDirectory: true}, | 239 {fullPath:"/c", isDirectory: true}, |
240 {fullPath:"/c/d"}, | 240 {fullPath:"/c/d"}, |
241 ], | 241 ], |
242 tests: [ | 242 tests: [ |
243 function(helper) {helper.move("/a","/","c",FileError.INVALID_MODIFIC
ATION_ERR);} | 243 function(helper) {helper.move("/a","/","c",'InvalidModificationError
');} |
244 ], | 244 ], |
245 postcondition: [ | 245 postcondition: [ |
246 {fullPath:"/a", isDirectory: true}, | 246 {fullPath:"/a", isDirectory: true}, |
247 {fullPath:"/a/b"}, | 247 {fullPath:"/a/b"}, |
248 {fullPath:"/c", isDirectory: true}, | 248 {fullPath:"/c", isDirectory: true}, |
249 {fullPath:"/c/d"}, | 249 {fullPath:"/c/d"}, |
250 ], | 250 ], |
251 }, | 251 }, |
252 ]; | 252 ]; |
OLD | NEW |