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

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

Issue 10392023: Change dart:io to use Future for one-shot operations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Adding stable test binaries Created 8 years, 7 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 | « tools/testing/dart/test_runner.dart ('k') | utils/compiler/build_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_suite.dart
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index 9c42f863baaa96116fff591f90667b415edc4203..b715d61a241cbc8e36511e77f3fa3d9061657d14 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -59,7 +59,7 @@ class CCTestListerIsolate extends Isolate {
void main() {
port.receive((String runnerPath, SendPort replyTo) {
- var p = new Process.start(runnerPath, ["--list"]);
+ var p = Process.start(runnerPath, ["--list"]);
StringInputStream stdoutStream = new StringInputStream(p.stdout);
List<String> tests = new List<String>();
stdoutStream.onLine = () {
@@ -332,17 +332,14 @@ class StandardTestSuite implements TestSuite {
void processDirectory() {
directoryPath = '$dartDir/$directoryPath';
Directory dir = new Directory(directoryPath);
- dir.onError = (s) {
- throw s;
- };
- dir.exists((bool exists) {
+ dir.exists().then((exists) {
if (!exists) {
print('Directory containing tests not found: $directoryPath');
directoryListingDone(false);
} else {
- dir.onFile = processFile;
- dir.onDone = directoryListingDone;
- dir.list(recursive: listRecursively());
+ var lister = dir.list(recursive: listRecursively());
+ lister.onFile = processFile;
+ lister.onDone = directoryListingDone;
}
});
}
@@ -1054,9 +1051,9 @@ class DartcCompilationTestSuite extends StandardTestSuite {
dir.onError = (s) {
throw s;
};
- dir.onFile = processFile;
- dir.onDone = (ignore) => activityCompleted();
- dir.list(recursive: listRecursively());
+ var lister = dir.list(recursive: listRecursively());
+ lister.onFile = processFile;
+ lister.onDone = (ignore) => activityCompleted();
}
}
// Completed the enqueueing of listers.
@@ -1121,9 +1118,9 @@ class JUnitTestSuite implements TestSuite {
dir.onError = (s) {
throw s;
};
- dir.onFile = processFile;
- dir.onDone = createTest;
- dir.list(recursive: true);
+ var lister = dir.list(recursive: true);
+ lister.onFile = processFile;
+ lister.onDone = createTest;
}
void processFile(String filename) {
« no previous file with comments | « tools/testing/dart/test_runner.dart ('k') | utils/compiler/build_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698