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

Unified Diff: pkg/analysis_testing/lib/reflective_tests.dart

Issue 416563002: Abort analysis server integration tests in the event of async errors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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 | « pkg/analysis_server/test/integration/integration_tests.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_testing/lib/reflective_tests.dart
diff --git a/pkg/analysis_testing/lib/reflective_tests.dart b/pkg/analysis_testing/lib/reflective_tests.dart
index 2c737f7910d74df36c85d58208c30837eccd80af..ec293189682dd9dcef06763c2560fa95169727f9 100644
--- a/pkg/analysis_testing/lib/reflective_tests.dart
+++ b/pkg/analysis_testing/lib/reflective_tests.dart
@@ -45,20 +45,26 @@ void runReflectiveTests(Type type) {
return;
}
String memberName = MirrorSystem.getName(symbol);
+ wrapTest() {
+ var result = _runTest(classMirror, symbol);
+ if (result is Future) {
+ // We can't just return the future because of dartbug.com/20153. So
+ // use expectAsync() to ensure that the test doesn't end until the
+ // future completes. TODO(paulberry): get rid of this workaround once
+ // 20153 is fixed.
+ result.then(expectAsync((_) {}));
+ }
+ }
// test_
if (memberName.startsWith('test_')) {
String testName = memberName.substring('test_'.length);
- test(testName, () {
- return _runTest(classMirror, symbol);
- });
+ test(testName, wrapTest);
return;
}
// solo_test_
if (memberName.startsWith('solo_test_')) {
String testName = memberName.substring('solo_test_'.length);
- solo_test(testName, () {
- return _runTest(classMirror, symbol);
- });
+ solo_test(testName, wrapTest);
}
});
}
« no previous file with comments | « pkg/analysis_server/test/integration/integration_tests.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698