| 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 var libResult = await isolate.invokeRpcNoUpgrade('getObject', params); | 164 var libResult = await isolate.invokeRpcNoUpgrade('getObject', params); |
| 165 // Get the first script. | 165 // Get the first script. |
| 166 params = { | 166 params = { |
| 167 'objectId': libResult['scripts'][0]['id'], | 167 'objectId': libResult['scripts'][0]['id'], |
| 168 }; | 168 }; |
| 169 var result = await isolate.invokeRpcNoUpgrade('getObject', params); | 169 var result = await isolate.invokeRpcNoUpgrade('getObject', params); |
| 170 expect(result['type'], equals('Script')); | 170 expect(result['type'], equals('Script')); |
| 171 expect(result['id'], startsWith('libraries/')); | 171 expect(result['id'], startsWith('libraries/')); |
| 172 expect(result['uri'], startsWith('file:')); | 172 expect(result['uri'], startsWith('file:')); |
| 173 expect(result['uri'], endsWith('get_object_rpc_test.dart')); | 173 expect(result['uri'], endsWith('get_object_rpc_test.dart')); |
| 174 expect(result['kind'], equals('script')); | 174 expect(result['_kind'], equals('script')); |
| 175 expect(result['library']['type'], equals('@Library')); | 175 expect(result['library']['type'], equals('@Library')); |
| 176 expect(result['source'], startsWith('// Copyright (c)')); | 176 expect(result['source'], startsWith('// Copyright (c)')); |
| 177 expect(result['tokenPosTable'].length, isPositive); | 177 expect(result['tokenPosTable'].length, isPositive); |
| 178 expect(result['tokenPosTable'][0], new isInstanceOf<List>()); | 178 expect(result['tokenPosTable'][0], new isInstanceOf<List>()); |
| 179 expect(result['tokenPosTable'][0].length, isPositive); | 179 expect(result['tokenPosTable'][0].length, isPositive); |
| 180 expect(result['tokenPosTable'][0][0], new isInstanceOf<int>()); | 180 expect(result['tokenPosTable'][0][0], new isInstanceOf<int>()); |
| 181 }, | 181 }, |
| 182 | 182 |
| 183 // invalid script. | 183 // invalid script. |
| 184 (Isolate isolate) async { | 184 (Isolate isolate) async { |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 caughtException = true; | 415 caughtException = true; |
| 416 expect(e.code, equals(ServerRpcException.kInvalidParams)); | 416 expect(e.code, equals(ServerRpcException.kInvalidParams)); |
| 417 expect(e.message, | 417 expect(e.message, |
| 418 "getObject: invalid 'objectId' parameter: code/0"); | 418 "getObject: invalid 'objectId' parameter: code/0"); |
| 419 } | 419 } |
| 420 expect(caughtException, isTrue); | 420 expect(caughtException, isTrue); |
| 421 }, | 421 }, |
| 422 ]; | 422 ]; |
| 423 | 423 |
| 424 main(args) async => runIsolateTests(args, tests, testeeBefore:warmup); | 424 main(args) async => runIsolateTests(args, tests, testeeBefore:warmup); |
| OLD | NEW |