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

Unified Diff: pkg/analysis_server/test/completion_test_support.dart

Issue 787863003: Make completion tests handle exceptions during getSuggestions(). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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: pkg/analysis_server/test/completion_test_support.dart
diff --git a/pkg/analysis_server/test/completion_test_support.dart b/pkg/analysis_server/test/completion_test_support.dart
index 6335be72bca7d6928b236c3b9d09d4ccf5be12ff..bca1b38b44361644c1212c0164950b2c567fb31d 100644
--- a/pkg/analysis_server/test/completion_test_support.dart
+++ b/pkg/analysis_server/test/completion_test_support.dart
@@ -65,28 +65,27 @@ class CompletionTestCase extends CompletionTest {
runTest(LocationSpec spec, [Map<String, String> extraFiles]) {
super.setUp();
- String content = spec.source;
- addFile(testFile, content);
- this.testCode = content;
- completionOffset = spec.testLocation;
- if (extraFiles != null) {
- extraFiles.forEach((String fileName, String content) {
- addFile(fileName, content);
- });
- }
- return getSuggestions().then((_) {
- try {
- //expect(replacementOffset, equals(completionOffset));
- //expect(replacementLength, equals(0));
- for (String result in spec.positiveResults) {
- assertHasCompletion(result);
- }
- for (String result in spec.negativeResults) {
- assertHasNoCompletion(result);
- }
- } finally {
- super.tearDown();
+ return new Future(() {
+ String content = spec.source;
+ addFile(testFile, content);
+ this.testCode = content;
+ completionOffset = spec.testLocation;
+ if (extraFiles != null) {
+ extraFiles.forEach((String fileName, String content) {
+ addFile(fileName, content);
+ });
+ }
+ }).then((_) => getSuggestions()).then((_) {
+ //expect(replacementOffset, equals(completionOffset));
+ //expect(replacementLength, equals(0));
+ for (String result in spec.positiveResults) {
+ assertHasCompletion(result);
+ }
+ for (String result in spec.negativeResults) {
+ assertHasNoCompletion(result);
}
+ }).whenComplete(() {
+ super.tearDown();
});
}
« 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