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=--compile-all --error_on_bad_type --error_on_bad_override | 4 // VMOptions=--compile-all --error_on_bad_type --error_on_bad_override |
5 | 5 |
6 library get_object_rpc_test; | 6 library get_object_rpc_test; |
7 | 7 |
8 import 'package:observatory/service_io.dart'; | 8 import 'package:observatory/service_io.dart'; |
9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
10 | 10 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 (Isolate isolate) async { | 118 (Isolate isolate) async { |
119 var params = { | 119 var params = { |
120 'objectId': isolate.rootLibrary.id, | 120 'objectId': isolate.rootLibrary.id, |
121 }; | 121 }; |
122 var result = await isolate.invokeRpcNoUpgrade('getObject', params); | 122 var result = await isolate.invokeRpcNoUpgrade('getObject', params); |
123 expect(result['type'], equals('Library')); | 123 expect(result['type'], equals('Library')); |
124 expect(result['id'], startsWith('libraries/')); | 124 expect(result['id'], startsWith('libraries/')); |
125 expect(result['name'], equals('get_object_rpc_test')); | 125 expect(result['name'], equals('get_object_rpc_test')); |
126 expect(result['uri'], startsWith('file:')); | 126 expect(result['uri'], startsWith('file:')); |
127 expect(result['uri'], endsWith('get_object_rpc_test.dart')); | 127 expect(result['uri'], endsWith('get_object_rpc_test.dart')); |
| 128 expect(result['debuggable'], equals(true)); |
128 expect(result['imports'].length, isPositive); | 129 expect(result['imports'].length, isPositive); |
129 expect(result['imports'][0]['type'], equals('@Library')); | 130 expect(result['imports'][0]['type'], equals('@Library')); |
130 expect(result['scripts'].length, isPositive); | 131 expect(result['scripts'].length, isPositive); |
131 expect(result['scripts'][0]['type'], equals('@Script')); | 132 expect(result['scripts'][0]['type'], equals('@Script')); |
132 expect(result['variables'].length, isPositive); | 133 expect(result['variables'].length, isPositive); |
133 expect(result['variables'][0]['type'], equals('@Field')); | 134 expect(result['variables'][0]['type'], equals('@Field')); |
134 expect(result['functions'].length, isPositive); | 135 expect(result['functions'].length, isPositive); |
135 expect(result['functions'][0]['type'], equals('@Function')); | 136 expect(result['functions'][0]['type'], equals('@Function')); |
136 expect(result['classes'].length, isPositive); | 137 expect(result['classes'].length, isPositive); |
137 expect(result['classes'][0]['type'], equals('@Class')); | 138 expect(result['classes'][0]['type'], equals('@Class')); |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 caughtException = true; | 416 caughtException = true; |
416 expect(e.code, equals(ServerRpcException.kInvalidParams)); | 417 expect(e.code, equals(ServerRpcException.kInvalidParams)); |
417 expect(e.message, | 418 expect(e.message, |
418 "getObject: invalid 'objectId' parameter: code/0"); | 419 "getObject: invalid 'objectId' parameter: code/0"); |
419 } | 420 } |
420 expect(caughtException, isTrue); | 421 expect(caughtException, isTrue); |
421 }, | 422 }, |
422 ]; | 423 ]; |
423 | 424 |
424 main(args) async => runIsolateTests(args, tests, testeeBefore:warmup); | 425 main(args) async => runIsolateTests(args, tests, testeeBefore:warmup); |
OLD | NEW |