Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #library('fileapi'); | |
| 2 #import('../../lib/unittest/unittest.dart'); | |
| 3 #import('../../lib/unittest/html_config.dart'); | |
| 4 #import('dart:html'); | |
| 5 | |
| 6 main() { | |
| 7 useHtmlConfiguration(); | |
| 8 window.webkitRequestFileSystem(Window.TEMPORARY, 100, (fs) { | |
| 9 // FIXME: add types to callback arguments after migration to wrapperless dar t:html. | |
| 10 asyncTest('getDirectory', 2, () { | |
| 11 Expect.throws(() => fs.root.getDirectory('directory1', {'x': true}, (e) {} )); | |
| 12 | |
| 13 fs.root.getDirectory('directory2', {}, (e) { | |
|
Anton Muhin
2012/05/15 18:32:23
this is very hard to read, but luckily starting fr
podivilov
2012/05/16 13:49:25
Done.
| |
| 14 Expect.fail('Should not be reached'); | |
| 15 callbackDone(); | |
| 16 }, (e) { | |
| 17 Expect.equals(FileError.NOT_FOUND_ERR, e.code); | |
| 18 callbackDone(); | |
| 19 }); | |
| 20 | |
| 21 fs.root.getDirectory('directory3', {'create': true}, (e) { | |
| 22 Expect.equals('directory3', e.name); | |
| 23 callbackDone(); | |
| 24 }, (e) { | |
| 25 Expect.fail('Got file error: ${e.code}'); | |
| 26 callbackDone(); | |
| 27 }); | |
| 28 }); | |
| 29 | |
| 30 asyncTest('getFile', 2, () { | |
| 31 Expect.throws(() => fs.root.getFile('file1', {'x': true}, (e) {})); | |
| 32 | |
| 33 fs.root.getDirectory('file2', {}, (e) { | |
| 34 Expect.fail('Should not be reached'); | |
| 35 callbackDone(); | |
| 36 }, (e) { | |
| 37 Expect.equals(FileError.NOT_FOUND_ERR, e.code); | |
| 38 callbackDone(); | |
| 39 }); | |
| 40 | |
| 41 fs.root.getDirectory('file3', {'create': true}, (e) { | |
| 42 Expect.equals('file3', e.name); | |
| 43 callbackDone(); | |
| 44 }, (e) { | |
| 45 Expect.fail('Got file error: ${e.code}'); | |
| 46 callbackDone(); | |
| 47 }); | |
| 48 }); | |
| 49 }); | |
| 50 } | |
| OLD | NEW |