Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | |
| 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. | |
| 4 // VMOptions=--error_on_bad_type --error_on_bad_override | |
| 5 | |
| 6 import 'package:observatory/service_io.dart'; | |
| 7 import 'package:unittest/unittest.dart'; | |
| 8 import 'test_helper.dart'; | |
| 9 import 'service_test_common.dart'; | |
| 10 | |
| 11 import 'evaluate_activation_in_method_class_other.dart'; | |
| 12 | |
|
hausner
2016/04/04 19:52:32
Would be nice to have a comment in this tests that
rmacnak
2016/04/04 22:07:26
Done.
| |
| 13 class Subclass extends Klass { | |
| 14 var _instVar = 'Subclass'; | |
| 15 var instVar = 'Subclass'; | |
| 16 method() => 'Subclass'; | |
| 17 static staticMethod() => 'Subclass'; | |
| 18 } | |
| 19 | |
| 20 testeeDo() { | |
| 21 var obj = new Subclass(); | |
| 22 obj.test(); | |
| 23 } | |
| 24 | |
| 25 testerDo(Isolate isolate) async { | |
| 26 await hasStoppedAtBreakpoint(isolate); | |
| 27 | |
| 28 // Make sure we are in the right place. | |
| 29 var stack = await isolate.getStack(); | |
| 30 var topFrame = 0; | |
| 31 expect(stack.type, equals('Stack')); | |
| 32 expect(stack['frames'][topFrame].function.name, equals('test')); | |
| 33 expect(stack['frames'][topFrame].function.dartOwner.name, equals('Klass')); | |
| 34 | |
| 35 var result; | |
| 36 | |
| 37 result = await isolate.evalFrame(topFrame, '_local'); | |
| 38 print(result); | |
| 39 expect(result.valueAsString, equals('Klass')); | |
| 40 | |
| 41 result = await isolate.evalFrame(topFrame, '_instVar'); | |
| 42 print(result); | |
| 43 expect(result.valueAsString, equals('Klass')); | |
| 44 | |
| 45 result = await isolate.evalFrame(topFrame, 'instVar'); | |
| 46 print(result); | |
| 47 expect(result.valueAsString, equals('Subclass')); | |
| 48 | |
| 49 result = await isolate.evalFrame(topFrame, 'method()'); | |
| 50 print(result); | |
| 51 expect(result.valueAsString, equals('Subclass')); | |
| 52 | |
| 53 result = await isolate.evalFrame(topFrame, 'super._instVar'); | |
| 54 print(result); | |
| 55 expect(result.valueAsString, equals('Superclass')); | |
| 56 | |
| 57 result = await isolate.evalFrame(topFrame, 'super.instVar'); | |
| 58 print(result); | |
| 59 expect(result.valueAsString, equals('Superclass')); | |
| 60 | |
| 61 result = await isolate.evalFrame(topFrame, 'super.method()'); | |
| 62 print(result); | |
| 63 expect(result.valueAsString, equals('Superclass')); | |
| 64 | |
| 65 result = await isolate.evalFrame(topFrame, 'staticMethod()'); | |
| 66 print(result); | |
| 67 expect(result.valueAsString, equals('Klass')); | |
| 68 } | |
| 69 | |
| 70 main(args) => runIsolateTests(args, [testerDo], testeeConcurrent:testeeDo); | |
| OLD | NEW |