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

Unified Diff: tests/standalone/io/fuzz_support.dart

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/standalone/io/file_write_as_test.dart ('k') | tests/standalone/io/http_advanced_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/fuzz_support.dart
diff --git a/tests/standalone/io/fuzz_support.dart b/tests/standalone/io/fuzz_support.dart
index 64f96a75b5ddcb8f94555d0263f24a7c7ae6228f..4c7cd1cd3990767b79e0bc106154bed7b3b24ae7 100644
--- a/tests/standalone/io/fuzz_support.dart
+++ b/tests/standalone/io/fuzz_support.dart
@@ -4,7 +4,8 @@
library fuzz_support;
-import "dart:io";
+import 'dart:async';
+import 'dart:io';
const typeMapping = const {
'null': null,
@@ -46,14 +47,7 @@ doItSync(Function f) {
// Perform async operation and transform the future for the operation
// into a future that never fails by treating errors as normal
// completion.
-Future doItAsync(Function f) {
+Future doItAsync(void f()) {
// Ignore value and errors.
- var completer = new Completer();
- var future = f();
- future.handleException((e) {
- completer.complete(true);
- return true;
- });
- future.then((v) => completer.complete(true));
- return completer.future;
+ return new Future.delayed(0, f).catchError((_) {}).then((_) => true);
}
« no previous file with comments | « tests/standalone/io/file_write_as_test.dart ('k') | tests/standalone/io/http_advanced_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698