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

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

Issue 14070010: Refactor Future constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added co19 issue number. Created 7 years, 8 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 | « tests/compiler/dart2js/memory_source_file_helper.dart ('k') | tests/html/websql_test.dart » ('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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 // Do the boilerplate to get several files and directories created to then 93 // Do the boilerplate to get several files and directories created to then
94 // test the functions that use those items. 94 // test the functions that use those items.
95 Future doDirSetup() { 95 Future doDirSetup() {
96 return fs.root.createFile( 96 return fs.root.createFile(
97 'file4') 97 'file4')
98 .then((FileEntry file) { 98 .then((FileEntry file) {
99 return fs.root.createDirectory( 99 return fs.root.createDirectory(
100 'directory3') 100 'directory3')
101 .then((DirectoryEntry dir) { 101 .then((DirectoryEntry dir) {
102 return new Future.immediate(new FileAndDir(file, dir)); 102 return new Future.value(new FileAndDir(file, dir));
103 }); 103 });
104 }); 104 });
105 } 105 }
106 106
107 group('directoryReader', () { 107 group('directoryReader', () {
108 if (FileSystem.supported) { 108 if (FileSystem.supported) {
109 test('getFileSystem', getFileSystem); 109 test('getFileSystem', getFileSystem);
110 110
111 test('readEntries', () { 111 test('readEntries', () {
112 return doDirSetup() 112 return doDirSetup()
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 expect(fileObj.name, fileAndDir.file.name); 189 expect(fileObj.name, fileAndDir.file.name);
190 expect(fileObj.relativePath, ''); 190 expect(fileObj.relativePath, '');
191 expect(new DateTime.now().difference( 191 expect(new DateTime.now().difference(
192 fileObj.lastModifiedDate).inSeconds, lessThan(60)); 192 fileObj.lastModifiedDate).inSeconds, lessThan(60));
193 }); 193 });
194 }); 194 });
195 }); 195 });
196 } 196 }
197 }); 197 });
198 } 198 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/memory_source_file_helper.dart ('k') | tests/html/websql_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698