Index: runtime/observatory/tests/service/malformed_test.dart |
diff --git a/runtime/observatory/tests/service/malformed_test.dart b/runtime/observatory/tests/service/malformed_test.dart |
index 1d61a46a73ad06cf914aa2da72d551a4b99fb06f..b5f86dd5c4c753a18f978009a3a7800a56829169 100644 |
--- a/runtime/observatory/tests/service/malformed_test.dart |
+++ b/runtime/observatory/tests/service/malformed_test.dart |
@@ -8,22 +8,25 @@ import 'package:unittest/unittest.dart'; |
import 'test_helper.dart'; |
var tests = [ |
+ (Isolate isolate) async { |
+ await isolate.invokeRpc('_respondWithMalformedObject', {}).then((result) { |
+ expect(false, isTrue, reason:'Unreachable'); |
+ }).catchError((ServiceException exception) { |
+ expect(exception.kind, equals('ResponseFormatException')); |
+ expect(exception.message, |
+ startsWith("Response is missing the 'type' field")); |
+ }); |
+ }, |
-(Isolate isolate) => |
- isolate.invokeRpc('_respondWithMalformedJson', { }).then((result) { |
- // Should not execute. |
- expect(true, false); |
- }).catchError((ServiceException exception) { |
- expect(exception.kind, equals('JSONDecodeException')); |
- }), |
- |
-(Isolate isolate) => |
- isolate.invokeRpc('_respondWithMalformedObject', { }).then((result) { |
- // Should not execute. |
- expect(true, false); |
- }).catchError((ServiceException exception) { |
- expect(exception.kind, equals('ResponseFormatException')); |
- }), |
+ // Do this test last... it kills the vm connection. |
+ (Isolate isolate) async { |
+ await isolate.invokeRpc('_respondWithMalformedJson', {}).then((result) { |
+ expect(false, isTrue, reason:'Unreachable'); |
+ }).catchError((ServiceException exception) { |
+ expect(exception.kind, equals('ConnectionClosed')); |
+ expect(exception.message, startsWith('Error decoding JSON message')); |
+ }); |
+ }, |
]; |
main(args) => runIsolateTests(args, tests); |