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

Side by Side Diff: tests/standalone/io/directory_fuzz_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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // 'fuzz' test the directory APIs by providing unexpected type 5 // 'fuzz' test the directory APIs by providing unexpected type
6 // arguments. The test passes if the VM does not crash. 6 // arguments. The test passes if the VM does not crash.
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:io'; 9 import 'dart:io';
10 import 'dart:isolate'; 10 import 'dart:isolate';
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 futures.add(doItAsync(d.create)); 44 futures.add(doItAsync(d.create));
45 futures.add(doItAsync(d.delete)); 45 futures.add(doItAsync(d.delete));
46 futures.add(doItAsync(() { 46 futures.add(doItAsync(() {
47 return d.createTemp().then((temp) { 47 return d.createTemp().then((temp) {
48 return temp.delete(); 48 return temp.delete();
49 }); 49 });
50 })); 50 }));
51 futures.add(doItAsync(() { 51 futures.add(doItAsync(() {
52 return d.exists().then((res) { 52 return d.exists().then((res) {
53 if (!res) return d.delete(recursive: true); 53 if (!res) return d.delete(recursive: true);
54 return new Future.immediate(true); 54 return new Future.value(true);
55 }); 55 });
56 })); 56 }));
57 typeMapping.forEach((k2, v2) { 57 typeMapping.forEach((k2, v2) {
58 futures.add(doItAsync(() => d.rename(v2))); 58 futures.add(doItAsync(() => d.rename(v2)));
59 futures.add(doItAsync(() { 59 futures.add(doItAsync(() {
60 d.list(recursive: v2).listen((_) {}, onError: (e) => null); 60 d.list(recursive: v2).listen((_) {}, onError: (e) => null);
61 })); 61 }));
62 }); 62 });
63 }); 63 });
64 Future.wait(futures).then((ignore) => port.close()); 64 Future.wait(futures).then((ignore) => port.close());
65 } 65 }
66 66
67 main() { 67 main() {
68 fuzzSyncMethods(); 68 fuzzSyncMethods();
69 fuzzAsyncMethods(); 69 fuzzAsyncMethods();
70 } 70 }
OLDNEW
« no previous file with comments | « tests/lib/async/slow_consumer_test.dart ('k') | tests/standalone/io/file_system_delete_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698