| OLD | NEW |
| 1 library fileapi; | 1 library fileapi; |
| 2 import '../../pkg/unittest/lib/unittest.dart'; | 2 import '../../pkg/unittest/lib/unittest.dart'; |
| 3 import '../../pkg/unittest/lib/html_individual_config.dart'; | 3 import '../../pkg/unittest/lib/html_individual_config.dart'; |
| 4 import 'dart:html'; | 4 import 'dart:html'; |
| 5 import 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 class FileAndDir { | 7 class FileAndDir { |
| 8 FileEntry file; | 8 FileEntry file; |
| 9 DirectoryEntry dir; | 9 DirectoryEntry dir; |
| 10 FileAndDir(this.file, this.dir); | 10 FileAndDir(this.file, this.dir); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 test('fileCreate', () { | 77 test('fileCreate', () { |
| 78 return fs.root.getFile( | 78 return fs.root.getFile( |
| 79 'file4', | 79 'file4', |
| 80 options: {'create': true}) | 80 options: {'create': true}) |
| 81 .then((FileEntry e) { | 81 .then((FileEntry e) { |
| 82 expect(e.name, equals('file4')); | 82 expect(e.name, equals('file4')); |
| 83 expect(e.isFile, isTrue); | 83 expect(e.isFile, isTrue); |
| 84 return e.getMetadata(); | 84 return e.getMetadata(); |
| 85 }).then((Metadata metadata) { | 85 }).then((Metadata metadata) { |
| 86 var changeTime = metadata.modificationTime; | 86 var changeTime = metadata.modificationTime; |
| 87 expect(new DateTime.now().difference(changeTime).inSeconds, | 87 // Upped because our Windows buildbots can sometimes be particularly |
| 88 lessThan(60)); | 88 // slow. |
| 89 expect(new DateTime.now().difference(changeTime).inMinutes, |
| 90 lessThan(4)); |
| 89 expect(metadata.size, equals(0)); | 91 expect(metadata.size, equals(0)); |
| 90 }); | 92 }); |
| 91 }); | 93 }); |
| 92 } | 94 } |
| 93 }); | 95 }); |
| 94 | 96 |
| 95 // Do the boilerplate to get several files and directories created to then | 97 // Do the boilerplate to get several files and directories created to then |
| 96 // test the functions that use those items. | 98 // test the functions that use those items. |
| 97 Future doDirSetup() { | 99 Future doDirSetup() { |
| 98 return fs.root.getFile( | 100 return fs.root.getFile( |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 expect(fileObj.name, fileAndDir.file.name); | 195 expect(fileObj.name, fileAndDir.file.name); |
| 194 expect(fileObj.relativePath, ''); | 196 expect(fileObj.relativePath, ''); |
| 195 expect(new DateTime.now().difference( | 197 expect(new DateTime.now().difference( |
| 196 fileObj.lastModifiedDate).inSeconds, lessThan(60)); | 198 fileObj.lastModifiedDate).inSeconds, lessThan(60)); |
| 197 }); | 199 }); |
| 198 }); | 200 }); |
| 199 }); | 201 }); |
| 200 } | 202 } |
| 201 }); | 203 }); |
| 202 } | 204 } |
| OLD | NEW |