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

Unified Diff: pkg/analysis_server/test/integration/integration_tests.dart

Issue 415663002: Allow an analysis server response to have both "error" and "result" fields. (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 | « 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/integration/integration_tests.dart
diff --git a/pkg/analysis_server/test/integration/integration_tests.dart b/pkg/analysis_server/test/integration/integration_tests.dart
index de0af377fad10b105dd3c25c43727f8139ba8990..2b28fd38baf82e7c1d6a6c62f024e13fe4124417 100644
--- a/pkg/analysis_server/test/integration/integration_tests.dart
+++ b/pkg/analysis_server/test/integration/integration_tests.dart
@@ -146,11 +146,12 @@ abstract class AbstractAnalysisServerIntegrationTest {
// Matchers common to all domains
// ------------------------------
-const Matcher isResultResponse = const MatchesJsonObject('result response',
+const Matcher isResponse = const MatchesJsonObject('response',
const {
'id': isString
}, optionalFields: const {
- 'result': anything
+ 'result': anything,
+ 'error': isError
});
const Matcher isError = const MatchesJsonObject('Error', const {
@@ -166,12 +167,6 @@ const Matcher isError = const MatchesJsonObject('Error', const {
'data': anything
});
-const Matcher isErrorResponse = const MatchesJsonObject('error response', const
- {
- 'id': isString,
- 'error': isError
-});
-
const Matcher isNotification = const MatchesJsonObject('notification', const {
'event': isString
}, optionalFields: const {
@@ -529,17 +524,13 @@ class Server {
// TODO(paulberry): propagate the error info to the completer.
completer.completeError(new UnimplementedError(
'Server responded with an error'));
- // Check that the message is well-formed. We do this after calling
- // completer.completeError() so that we don't stall the test in the
- // event of an error.
- expect(message, isErrorResponse);
} else {
completer.complete(messageAsMap['result']);
- // Check that the message is well-formed. We do this after calling
- // completer.complete() so that we don't stall the test in the
- // event of an error.
- expect(message, isResultResponse);
}
+ // Check that the message is well-formed. We do this after calling
+ // completer.complete() or completer.completeError() so that we don't
+ // stall the test in the event of an error.
+ expect(message, isResponse);
} else {
// Message is a notification. It should have an event and possibly
// params.
« 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