| 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 'dart:async'; | |
| 9 | |
| 10 import 'package:observatory/service_io.dart'; | 8 import 'package:observatory/service_io.dart'; |
| 11 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
| 12 | 10 |
| 13 import 'test_helper.dart'; | 11 import 'test_helper.dart'; |
| 14 | 12 |
| 15 class _DummyClass { | 13 class _DummyClass { |
| 16 static var dummyVar = 11; | 14 static var dummyVar = 11; |
| 17 void dummyFunction() { | 15 void dummyFunction() { |
| 18 } | 16 } |
| 19 } | 17 } |
| 20 | 18 |
| 21 class _DummySubClass extends _DummyClass { | 19 class _DummySubClass extends _DummyClass { |
| 22 } | 20 } |
| 23 | 21 |
| 24 void warmup() { | 22 void warmup() { |
| 23 // Silence analyzer. |
| 24 new _DummySubClass(); |
| 25 new _DummyClass().dummyFunction(); | 25 new _DummyClass().dummyFunction(); |
| 26 } | 26 } |
| 27 | 27 |
| 28 eval(Isolate isolate, String expression) async { | 28 eval(Isolate isolate, String expression) async { |
| 29 Map params = { | 29 Map params = { |
| 30 'targetId': isolate.rootLib.id, | 30 'targetId': isolate.rootLib.id, |
| 31 'expression': expression, | 31 'expression': expression, |
| 32 }; | 32 }; |
| 33 return await isolate.invokeRpcNoUpgrade('eval', params); | 33 return await isolate.invokeRpcNoUpgrade('eval', params); |
| 34 } | 34 } |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 var params = { | 360 var params = { |
| 361 'objectId': 'code/0', | 361 'objectId': 'code/0', |
| 362 }; | 362 }; |
| 363 var result = await isolate.invokeRpcNoUpgrade('getObject', params); | 363 var result = await isolate.invokeRpcNoUpgrade('getObject', params); |
| 364 expect(result['type'], equals('Error')); | 364 expect(result['type'], equals('Error')); |
| 365 expect(result['message'], startsWith('Unrecognized object id')); | 365 expect(result['message'], startsWith('Unrecognized object id')); |
| 366 }, | 366 }, |
| 367 ]; | 367 ]; |
| 368 | 368 |
| 369 main(args) async => runIsolateTests(args, tests, testeeBefore:warmup); | 369 main(args) async => runIsolateTests(args, tests, testeeBefore:warmup); |
| OLD | NEW |