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

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

Issue 2793333002: Remove unused call to discoverPackagesInRepository from test scripts. (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | 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 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();
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698