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

Unified Diff: tools/testing/dart/multitest.dart

Issue 11275217: Refactor test.dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make test case enqueuing future based. Created 8 years, 1 month 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
Index: tools/testing/dart/multitest.dart
diff --git a/tools/testing/dart/multitest.dart b/tools/testing/dart/multitest.dart
index 34551dbc74ce9bd5cf079560f147c0db19e5f4dc..b67428505a39476926b8c12f71d3d026b4ef5301 100644
--- a/tools/testing/dart/multitest.dart
+++ b/tools/testing/dart/multitest.dart
@@ -188,11 +188,8 @@ Set<Path> _findAllRelativeImports(Path topLibrary) {
return foundImports;
}
-void DoMultitest(Path filePath,
- String outputDir,
- Path suiteDir,
- CreateTest doTest,
- VoidFunction multitestDone) {
+Future doMultitest(Path filePath, String outputDir, Path suiteDir,
+ CreateTest doTest) {
// Each new test is a single String value in the Map tests.
Map<String, String> tests = new Map<String, String>();
Map<String, Set<String>> outcomes = new Map<String, Set<String>>();
@@ -217,7 +214,7 @@ void DoMultitest(Path filePath,
}
// Wait until all imports are copied before scheduling test cases.
- Futures.wait(futureCopies).then((ignored) {
+ return Futures.wait(futureCopies).transform((_) {
String baseFilename = filePath.filenameWithoutExtension;
for (String key in tests.keys) {
final Path multitestFilename =
@@ -241,7 +238,8 @@ void DoMultitest(Path filePath,
hasFatalTypeErrors: enableFatalTypeErrors,
multitestOutcome: outcome);
}
- multitestDone();
+
+ return null;
Emily Fortuna 2012/11/09 01:41:44 shouldn't we get rid of these lines if we're retur
Bob Nystrom 2012/11/09 20:56:26 This code's a bit hard to read. So the return here
Emily Fortuna 2012/11/09 21:03:14 Oh, I see. And I apparently misread the indentatio
});
}

Powered by Google App Engine
This is Rietveld 408576698