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 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 14 matching lines...) Expand all Loading... |
25 target2 = new _TestClass(null, null); | 25 target2 = new _TestClass(null, null); |
26 globalObject = new _TestClass(target1, target2); | 26 globalObject = new _TestClass(target1, target2); |
27 | 27 |
28 target3 = new _TestClass(null, null); | 28 target3 = new _TestClass(null, null); |
29 globalList = new List(100); | 29 globalList = new List(100); |
30 globalList[12] = target3; | 30 globalList[12] = target3; |
31 } | 31 } |
32 | 32 |
33 eval(Isolate isolate, String expression) async { | 33 eval(Isolate isolate, String expression) async { |
34 Map params = { | 34 Map params = { |
35 'targetId': isolate.rootLib.id, | 35 'targetId': isolate.rootLibrary.id, |
36 'expression': expression, | 36 'expression': expression, |
37 }; | 37 }; |
38 return await isolate.invokeRpcNoUpgrade('eval', params); | 38 return await isolate.invokeRpcNoUpgrade('evaluate', params); |
39 } | 39 } |
40 | 40 |
41 var tests = [ | 41 var tests = [ |
42 // simple path | 42 // simple path |
43 (Isolate isolate) async { | 43 (Isolate isolate) async { |
44 var obj = await eval(isolate, 'globalObject'); | 44 var obj = await eval(isolate, 'globalObject'); |
45 var params = { | 45 var params = { |
46 'targetId': obj['id'], | 46 'targetId': obj['id'], |
47 'limit': 4, | 47 'limit': 4, |
48 }; | 48 }; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 'limit': 4, | 103 'limit': 4, |
104 }; | 104 }; |
105 var result = await isolate.invokeRpcNoUpgrade('_getRetainingPath', params); | 105 var result = await isolate.invokeRpcNoUpgrade('_getRetainingPath', params); |
106 expect(result['type'], equals('RetainingPath')); | 106 expect(result['type'], equals('RetainingPath')); |
107 expect(result['elements'][0]['parentListIndex'], equals(12)); | 107 expect(result['elements'][0]['parentListIndex'], equals(12)); |
108 expect(result['elements'][2]['value']['name'], equals('globalList')); | 108 expect(result['elements'][2]['value']['name'], equals('globalList')); |
109 }, | 109 }, |
110 ]; | 110 ]; |
111 | 111 |
112 main(args) async => runIsolateTests(args, tests, testeeBefore:warmup); | 112 main(args) async => runIsolateTests(args, tests, testeeBefore:warmup); |
OLD | NEW |