Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Side by Side Diff: tests/html/fileapi_test.dart

Issue 12638016: Add a larger time window for file creation test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/html/html.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698