| Index: tests/standalone/vmservice/test_helper.dart
|
| diff --git a/tests/standalone/vmservice/test_helper.dart b/tests/standalone/vmservice/test_helper.dart
|
| index 9de301ef02785a4f99f97f688eb3b11c0ef68eef..fed4631ceabf1e8c49c41254bbf3ea97f7662c26 100644
|
| --- a/tests/standalone/vmservice/test_helper.dart
|
| +++ b/tests/standalone/vmservice/test_helper.dart
|
| @@ -48,11 +48,19 @@ abstract class VmServiceRequestHelper {
|
| onRequestFailed(e);
|
| return;
|
| }
|
| - // Received a map.
|
| - Expect.isTrue(reply is Map);
|
| - // Has a 'type' key.
|
| - Expect.isNotNull(reply['type']);
|
| - onRequestCompleted(reply);
|
| + if (reply is! Map) {
|
| + onRequestFailed('Reply was not a map: $reply');
|
| + return;
|
| + }
|
| + if (reply['type'] == null) {
|
| + onRequestFailed('Reply does not contain a type key: $reply');
|
| + return;
|
| + }
|
| + try {
|
| + onRequestCompleted(reply);
|
| + } catch(e) {
|
| + onRequestFailed('Test callback failed: $e');
|
| + }
|
| }
|
|
|
| void onRequestFailed(dynamic error) {
|
|
|