Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / filesystem / resources / op-get-entry.js
blob6c06f5609a80f552315a43863a9137be86c251f3
1 var testCases = [
3 name: 'CreateSimple',
4 precondition: [ ],
5 tests: [
6 function(helper) { helper.getDirectory('/', 'a', {create:true}); },
7 function(helper) { helper.getFile('/', 'b', {create:true}); }
8 ],
9 postcondition: [
10 {fullPath:'/a', isDirectory:true},
11 {fullPath:'/b'},
15 name: 'CreateNested',
16 precondition: [ ],
17 tests: [
18 function(helper) { helper.getDirectory('/', 'a', {create:true}); },
19 function(helper) { helper.getDirectory('/a', 'b', {create:true}); },
20 function(helper) { helper.getDirectory('/a/b', 'c', {create:true}); },
21 function(helper) { helper.getDirectory('/a/b/c', 'd', {create:true}); },
22 function(helper) { helper.getFile('/a/b/c/d', 'e', {create:true}); },
24 postcondition: [
25 {fullPath:'/a/b/c/d/e'},
29 name: 'CreateNestedWithAbsolutePath',
30 precondition: [
31 {fullPath:'/dummy', isDirectory:true},
33 tests: [
34 function(helper) { helper.getDirectory('/dummy', '/a', {create:true}); },
35 function(helper) { helper.getDirectory('/dummy', '/a/b', {create:true}); },
36 function(helper) { helper.getDirectory('/dummy', '/a/b/c', {create:true}); },
37 function(helper) { helper.getDirectory('/dummy', '/a/b/c/d', {create:true}); },
38 function(helper) { helper.getFile('/dummy', '/a/b/c/d/e', {create:true}); }
40 postcondition: [
41 {fullPath:'/dummy', isDirectory:true},
42 {fullPath:'/a/b/c/d/e'},
46 name: 'CreateNestedWithRelativePath',
47 precondition: [
48 {fullPath:'/a', isDirectory:true},
50 tests: [
51 function(helper) { helper.getDirectory('/a', './b', {create:true}); },
52 function(helper) { helper.getDirectory('/a', '../b', {create:true}); },
53 function(helper) { helper.getDirectory('/a', '../../b/c', {create:true}); },
54 function(helper) { helper.getDirectory('/a', '/a/../../d', {create:true}); },
55 function(helper) { helper.getDirectory('/a', '/a/../../b/./c/../../../../../e', {create:true}); },
56 function(helper) { helper.getDirectory('/a', '/a/../.../g', {create:true}, 'EncodingError'); },
57 function(helper) { helper.getFile('/a', './b.txt', {create:true}); },
58 function(helper) { helper.getFile('/a', '../b.txt', {create:true}); },
59 function(helper) { helper.getFile('/a', '../../b/c.txt', {create:true}); },
60 function(helper) { helper.getFile('/a', '/a/../../d.txt', {create:true}); },
61 function(helper) { helper.getFile('/a', '/a/../../b/./c/../../../../../e.txt', {create:true}); },
62 function(helper) { helper.getFile('/a', '/a/../.../g.txt', {create:true}, 'EncodingError'); },
64 postcondition: [
65 {fullPath:'/a', isDirectory:true},
66 {fullPath:'/a/b', isDirectory:true},
67 {fullPath:'/b', isDirectory:true},
68 {fullPath:'/b/c', isDirectory:true},
69 {fullPath:'/d', isDirectory:true},
70 {fullPath:'/e', isDirectory:true},
71 {fullPath:'/f', nonexistent:true},
72 {fullPath:'/a/f', nonexistent:true},
73 {fullPath:'/g', nonexistent:true},
74 {fullPath:'/a/g', nonexistent:true},
75 {fullPath:'/a/b.txt'},
76 {fullPath:'/b.txt'},
77 {fullPath:'/b/c.txt'},
78 {fullPath:'/d.txt'},
79 {fullPath:'/e.txt'},
80 {fullPath:'/f.txt', nonexistent:true},
81 {fullPath:'/a/f.txt', nonexistent:true},
82 {fullPath:'/g.txt', nonexistent:true},
83 {fullPath:'/a/g.txt', nonexistent:true},
87 name: 'GetExistingEntry',
88 precondition: [ ],
89 tests: [
90 function(helper) { helper.getDirectory('/', 'a', {create:true}); },
91 function(helper) { helper.getFile('/', 'b', {create:true}); },
92 function(helper) { helper.getDirectory('/', 'a'); },
93 function(helper) { helper.getFile('/', 'b'); }
95 postcondition: [
96 {fullPath:'/a', isDirectory:true},
97 {fullPath:'/b'},
101 name: 'GetNonExistent',
102 precondition: [ ],
103 tests: [
104 function(helper) { helper.getDirectory('/', 'a', {}, 'NotFoundError'); },
105 function(helper) { helper.getFile('/', 'b', {}, 'NotFoundError'); },
106 function(helper) { helper.getDirectory('/', '/nonexistent/a', {create:true}, 'NotFoundError'); },
107 function(helper) { helper.getFile('/', '/nonexistent/b', {create:true}, 'NotFoundError'); }
109 postcondition: [ ],
112 name: 'GetFileForDirectory',
113 precondition: [
114 {fullPath:'/a', isDirectory:true}
116 tests: [
117 function(helper) { helper.getFile('/', 'a', {}, 'TypeMismatchError'); },
118 function(helper) { helper.getFile('/', '/a', {}, 'TypeMismatchError'); },
120 postcondition: [
121 {fullPath:'/a', isDirectory:true}
125 name: 'GetDirectoryForFile',
126 precondition: [
127 {fullPath:'/a'}
129 tests: [
130 function(helper) { helper.getDirectory('/', 'a', {}, 'TypeMismatchError'); },
131 function(helper) { helper.getDirectory('/', '/a', {}, 'TypeMismatchError'); },
133 postcondition: [
134 {fullPath:'/a'}
138 name: 'CreateWithExclusive',
139 precondition: [
140 {fullPath:'/a', isDirectory:true},
141 {fullPath:'/b'}
143 tests: [
144 function(helper) { helper.getDirectory('/', 'a', {create:true, exclusive:true}, 'InvalidModificationError'); },
145 function(helper) { helper.getFile('/', 'b', {create:true, exclusive:true}, 'InvalidModificationError'); }
147 postcondition: [
148 {fullPath:'/a', isDirectory:true},
149 {fullPath:'/b'}