| OLD | NEW |
| 1 #library('fileapi'); | 1 #library('fileapi'); |
| 2 #import('../../pkg/unittest/unittest.dart'); | 2 #import('../../pkg/unittest/unittest.dart'); |
| 3 #import('../../pkg/unittest/html_config.dart'); | 3 #import('../../pkg/unittest/html_config.dart'); |
| 4 #import('dart:html'); | 4 #import('dart:html'); |
| 5 | 5 |
| 6 void fail(message) { | 6 void fail(message) { |
| 7 guardAsync(() { | 7 guardAsync(() { |
| 8 Expect.fail(message); | 8 expect(false, isTrue, reason: message); |
| 9 }); | 9 }); |
| 10 } | 10 } |
| 11 | 11 |
| 12 DOMFileSystem fs; | 12 DOMFileSystem fs; |
| 13 | 13 |
| 14 main() { | 14 main() { |
| 15 useHtmlConfiguration(); | 15 useHtmlConfiguration(); |
| 16 test('getFileSystem', () { | 16 test('getFileSystem', () { |
| 17 window.webkitRequestFileSystem(LocalWindow.TEMPORARY, 100, expectAsync1( | 17 window.webkitRequestFileSystem(LocalWindow.TEMPORARY, 100, expectAsync1( |
| 18 (DOMFileSystem fileSystem) { | 18 (DOMFileSystem fileSystem) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 expect(e.code, equals(FileError.NOT_FOUND_ERR)); | 62 expect(e.code, equals(FileError.NOT_FOUND_ERR)); |
| 63 })); | 63 })); |
| 64 }); | 64 }); |
| 65 | 65 |
| 66 test('fileCreate', () { | 66 test('fileCreate', () { |
| 67 fs.root.getFile( | 67 fs.root.getFile( |
| 68 'file4', | 68 'file4', |
| 69 options: {'create': true}, | 69 options: {'create': true}, |
| 70 successCallback: expectAsync1((FileEntry e) { | 70 successCallback: expectAsync1((FileEntry e) { |
| 71 expect(e.name, equals('file4')); | 71 expect(e.name, equals('file4')); |
| 72 expect(e.isFile, equals(true)); | 72 expect(e.isFile, isTrue); |
| 73 }), | 73 }), |
| 74 errorCallback: (e) { | 74 errorCallback: (e) { |
| 75 fail('Got file error: ${e.code}'); | 75 fail('Got file error: ${e.code}'); |
| 76 }); | 76 }); |
| 77 }); | 77 }); |
| 78 }); | 78 }); |
| 79 } | 79 } |
| OLD | NEW |