Chromium Code Reviews| Index: tools/testing/dart/test_suite.dart |
| diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart |
| index d0a8424ba1ab793d7772e7b2e6b7e1c6fa456965..735e159ff105f3aec5fb209a77015433d71392aa 100644 |
| --- a/tools/testing/dart/test_suite.dart |
| +++ b/tools/testing/dart/test_suite.dart |
| @@ -14,6 +14,7 @@ |
| */ |
| library test_suite; |
| +import "dart:async"; |
| import "dart:io"; |
| import "dart:isolate"; |
| import "status_file_parser.dart"; |
| @@ -72,12 +73,12 @@ class FutureGroup { |
| */ |
| void add(Future task) { |
| if (_pending == _FINISHED) { |
| - throw new FutureAlreadyCompleteException(); |
| + throw new Exception("FutureFutureAlreadyCompleteException"); |
| } |
| _pending++; |
| futures.add(task); |
|
Bill Hesse
2013/01/09 17:06:33
Add the return value of task.catchError(...).then(
kustermann
2013/01/09 18:02:25
Done.
|
| - task.handleException( |
| - (e) => _completer.completeException(e, task.stackTrace)); |
| + task.catchError( |
| + (e) => _completer.completeError(e.error, task.stackTrace)); |
| task.then((_) { |
| _pending--; |
| if (_pending == 0) { |
| @@ -273,7 +274,7 @@ void ccTestLister() { |
| }; |
| port.close(); |
| }); |
| - processFuture.handleException((e) { |
| + processFuture.catchError((e) { |
|
Bill Hesse
2013/01/09 17:06:33
another
kustermann
2013/01/09 18:02:25
Done.
|
| print("Failed to list tests: $runnerPath --list"); |
| replyTo.send(""); |
| return true; |
| @@ -474,11 +475,11 @@ class StandardTestSuite extends TestSuite { |
| List<String> additionalOptions(Path filePath) => []; |
| void forEachTest(TestCaseEvent onTest, Map testCache, [VoidFunction onDone]) { |
| - updateDartium().chain((_) { |
| + updateDartium().then((_) { |
| doTest = onTest; |
| return readExpectations(); |
| - }).chain((expectations) { |
| + }).then((expectations) { |
| testExpectations = expectations; |
| // Checked if we have already found and generated the tests for |
| @@ -552,7 +553,7 @@ class StandardTestSuite extends TestSuite { |
| Future enqueueTests() { |
| Directory dir = new Directory.fromPath(suiteDir); |
| - return dir.exists().chain((exists) { |
| + return dir.exists().then((exists) { |
| if (!exists) { |
| print('Directory containing tests missing: ${suiteDir.toNativePath()}'); |
| return new Future.immediate(null); |
| @@ -1320,7 +1321,7 @@ class StandardTestSuite extends TestSuite { |
| Iterable<Match> matches = testOptionsRegExp.allMatches(contents); |
| for (var match in matches) { |
| - result.add(match[1].split(' ').filter((e) => e != '')); |
| + result.add(match[1].split(' ').where((e) => e != '').toList()); |
| } |
| if (result.isEmpty) result.add([]); |
| @@ -1330,7 +1331,7 @@ class StandardTestSuite extends TestSuite { |
| throw new Exception( |
| 'More than one "// DartOptions=" line in test $filePath'); |
| } |
| - dartOptions = match[1].split(' ').filter((e) => e != ''); |
| + dartOptions = match[1].split(' ').where((e) => e != '').toList(); |
| } |
| matches = packageRootRegExp.allMatches(contents); |
| @@ -1358,7 +1359,7 @@ class StandardTestSuite extends TestSuite { |
| List<String> otherScripts = new List<String>(); |
| matches = otherScriptsRegExp.allMatches(contents); |
| for (var match in matches) { |
| - otherScripts.addAll(match[1].split(' ').filter((e) => e != '')); |
| + otherScripts.addAll(match[1].split(' ').where((e) => e != '').toList()); |
| } |
| bool isMultitest = multiTestRegExp.hasMatch(contents); |
| @@ -1386,9 +1387,9 @@ class StandardTestSuite extends TestSuite { |
| // top-level "groups" so tests running nested groups will be no-ops. |
| RegExp numTests = new RegExp(r"\s*[^/]\s*group\('[^,']*"); |
| List<String> subtestNames = []; |
| - Iterator matchesIter = numTests.allMatches(contents).iterator(); |
| - while(matchesIter.hasNext && isMultiHtmlTest) { |
| - String fullMatch = matchesIter.next().group(0); |
| + Iterator matchesIter = numTests.allMatches(contents).iterator; |
| + while(matchesIter.moveNext() && isMultiHtmlTest) { |
| + String fullMatch = matchesIter.current.group(0); |
| subtestNames.add(fullMatch.substring(fullMatch.indexOf("'") + 1)); |
| } |