Index: tools/testing/dart/test_suite.dart |
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart |
index 6900345815c33865ce908f06ce3b7a13770c9de3..45438f21352a167176cb992ec008730f194b6b23 100644 |
--- a/tools/testing/dart/test_suite.dart |
+++ b/tools/testing/dart/test_suite.dart |
@@ -727,38 +727,24 @@ class StandardTestSuite extends TestSuite { |
List<String> additionalOptions(Path filePath) => []; |
- Map<String, String> localPackageDirectories; |
- |
- void forEachTest(Function onTest, Map testCache, [VoidFunction onDone]) { |
- discoverPackagesInRepository().then((Map packageDirectories) { |
kustermann
2017/04/04 15:04:43
Can't you get rid of the discoverPackagesInReposit
Bill Hesse
2017/04/04 15:22:28
There is another use of it, in the PkgBuildTestSui
|
- localPackageDirectories = packageDirectories; |
- return updateDartium(); |
- }).then((_) { |
- doTest = onTest; |
- |
- return readExpectations(); |
- }).then((expectations) { |
- testExpectations = expectations; |
+ forEachTest(Function onTest, Map testCache, [VoidFunction onDone]) async { |
+ await updateDartium(); |
+ doTest = onTest; |
+ testExpectations = await readExpectations(); |
- // Checked if we have already found and generated the tests for |
- // this suite. |
- if (!testCache.containsKey(suiteName)) { |
- cachedTests = testCache[suiteName] = []; |
- return enqueueTests(); |
- } else { |
- // We rely on enqueueing completing asynchronously. |
Bill Hesse
2017/04/04 14:58:49
An await function always returns asynchronously, w
kustermann
2017/04/04 15:04:11
Acknowledged.
|
- return asynchronously(() { |
- for (var info in testCache[suiteName]) { |
- enqueueTestCaseFromTestInformation(info); |
- } |
- }); |
+ // Check if we have already found and generated the tests for this suite. |
+ if (!testCache.containsKey(suiteName)) { |
+ cachedTests = testCache[suiteName] = []; |
+ await enqueueTests(); |
+ } else { |
+ for (var info in testCache[suiteName]) { |
+ enqueueTestCaseFromTestInformation(info); |
} |
- }).then((_) { |
- testExpectations = null; |
- cachedTests = null; |
- doTest = null; |
- if (onDone != null) onDone(); |
- }); |
+ } |
+ testExpectations = null; |
+ cachedTests = null; |
+ doTest = null; |
+ if (onDone != null) onDone(); |
} |
/** |