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

Side by Side Diff: tests/standalone/io/file_system_async_links_test.dart

Issue 23886004: Update dart:io tests to use asyncStart/asyncEnd (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 7 years, 3 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "dart:async"; 5 import "dart:async";
6 import "dart:io";
7
8 import "package:async_helper/async_helper.dart";
6 import "package:expect/expect.dart"; 9 import "package:expect/expect.dart";
7 import "dart:io";
8 import "dart:isolate";
9
10 10
11 class FutureExpect { 11 class FutureExpect {
12 static Future isTrue(Future<bool> result) => 12 static Future isTrue(Future<bool> result) =>
13 result.then((value) => Expect.isTrue(value)); 13 result.then((value) => Expect.isTrue(value));
14 static Future isFalse(Future<bool> result) => 14 static Future isFalse(Future<bool> result) =>
15 result.then((value) => Expect.isFalse(value)); 15 result.then((value) => Expect.isFalse(value));
16 static Future equals(expected, Future result) => 16 static Future equals(expected, Future result) =>
17 result.then((value) => Expect.equals(expected, value)); 17 result.then((value) => Expect.equals(expected, value));
18 static Future listEquals(expected, Future result) => 18 static Future listEquals(expected, Future result) =>
19 result.then((value) => Expect.listEquals(expected, value)); 19 result.then((value) => Expect.listEquals(expected, value));
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 return true; 217 return true;
218 })) 218 }))
219 .then((_) => temp.delete(recursive: true)); 219 .then((_) => temp.delete(recursive: true));
220 }); 220 });
221 } 221 }
222 222
223 223
224 main() { 224 main() {
225 // Links on Windows are tested by windows_file_system_[async_]links_test. 225 // Links on Windows are tested by windows_file_system_[async_]links_test.
226 if (Platform.operatingSystem != 'windows') { 226 if (Platform.operatingSystem != 'windows') {
227 ReceivePort keepAlive = new ReceivePort(); 227 asyncStart();
228 testFileExistsCreate() 228 testFileExistsCreate()
229 .then((_) => testFileDelete()) 229 .then((_) => testFileDelete())
230 .then((_) => testFileWriteRead()) 230 .then((_) => testFileWriteRead())
231 .then((_) => testDirectoryExistsCreate()) 231 .then((_) => testDirectoryExistsCreate())
232 .then((_) => testDirectoryDelete()) 232 .then((_) => testDirectoryDelete())
233 .then((_) => testDirectoryListing()) 233 .then((_) => testDirectoryListing())
234 .then((_) => testDirectoryListingBrokenLink()) 234 .then((_) => testDirectoryListingBrokenLink())
235 .then((_) => keepAlive.close()); 235 .then((_) => asyncEnd());
236 } 236 }
237 } 237 }
OLDNEW
« no previous file with comments | « tests/standalone/io/file_stat_test.dart ('k') | tests/standalone/io/file_system_links_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698