| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // VMOptions=--error_on_bad_type --error_on_bad_override | 4 // VMOptions=--error_on_bad_type --error_on_bad_override |
| 5 | 5 |
| 6 import 'package:observatory/service_io.dart'; | 6 import 'package:observatory/service_io.dart'; |
| 7 import 'package:unittest/unittest.dart'; | 7 import 'package:unittest/unittest.dart'; |
| 8 | 8 |
| 9 import 'test_helper.dart'; | 9 import 'test_helper.dart'; |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 await vm.invokeRpcNoUpgrade('getIsolate', params); | 39 await vm.invokeRpcNoUpgrade('getIsolate', params); |
| 40 expect(false, isTrue, reason:'Unreachable'); | 40 expect(false, isTrue, reason:'Unreachable'); |
| 41 } on ServerRpcException catch(e) { | 41 } on ServerRpcException catch(e) { |
| 42 caughtException = true; | 42 caughtException = true; |
| 43 expect(e.code, equals(ServerRpcException.kInvalidParams)); | 43 expect(e.code, equals(ServerRpcException.kInvalidParams)); |
| 44 expect(e.message, | 44 expect(e.message, |
| 45 "getIsolate: invalid 'isolateId' parameter: badid"); | 45 "getIsolate: invalid 'isolateId' parameter: badid"); |
| 46 } | 46 } |
| 47 expect(caughtException, isTrue); | 47 expect(caughtException, isTrue); |
| 48 }, | 48 }, |
| 49 |
| 50 // Plausible isolate id, not found. |
| 51 (VM vm) async { |
| 52 var params = { |
| 53 'isolateId': 'isolates/9999999999', |
| 54 }; |
| 55 var result = await vm.invokeRpcNoUpgrade('getIsolate', params); |
| 56 expect(result['type'], equals('Sentinel')); |
| 57 expect(result['kind'], equals('Collected')); |
| 58 expect(result['valueAsString'], equals('<collected>')); |
| 59 }, |
| 49 ]; | 60 ]; |
| 50 | 61 |
| 51 main(args) async => runVMTests(args, tests); | 62 main(args) async => runVMTests(args, tests); |
| OLD | NEW |