| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 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 | 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=--error_on_bad_type --error_on_bad_override | 4 // VMOptions=--error_on_bad_type --error_on_bad_override |
| 5 | 5 |
| 6 // Tests that expressions evaluated in a frame see the same scope as the | 6 // Tests that expressions evaluated in a frame see the same scope as the |
| 7 // frame's method. | 7 // frame's method. |
| 8 | 8 |
| 9 import 'package:observatory/service_io.dart'; | 9 import 'package:observatory/service_io.dart'; |
| 10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 } | 29 } |
| 30 | 30 |
| 31 testerDo(Isolate isolate) async { | 31 testerDo(Isolate isolate) async { |
| 32 await hasStoppedAtBreakpoint(isolate); | 32 await hasStoppedAtBreakpoint(isolate); |
| 33 | 33 |
| 34 // Make sure we are in the right place. | 34 // Make sure we are in the right place. |
| 35 var stack = await isolate.getStack(); | 35 var stack = await isolate.getStack(); |
| 36 var topFrame = 0; | 36 var topFrame = 0; |
| 37 expect(stack.type, equals('Stack')); | 37 expect(stack.type, equals('Stack')); |
| 38 expect(stack['frames'][topFrame].function.name, equals('test')); | 38 expect(stack['frames'][topFrame].function.name, equals('test')); |
| 39 expect(stack['frames'][topFrame].function.dartOwner.name, equals('Superclass&K
lass')); | 39 expect(stack['frames'][topFrame].function.dartOwner.name, |
| 40 equals('Superclass&Klass')); |
| 40 | 41 |
| 41 var result; | 42 var result; |
| 42 | 43 |
| 43 result = await isolate.evalFrame(topFrame, '_local'); | 44 result = await isolate.evalFrame(topFrame, '_local'); |
| 44 print(result); | 45 print(result); |
| 45 expect(result.valueAsString, equals('Klass')); | 46 expect(result.valueAsString, equals('Klass')); |
| 46 | 47 |
| 47 result = await isolate.evalFrame(topFrame, '_instVar'); | 48 result = await isolate.evalFrame(topFrame, '_instVar'); |
| 48 print(result); | 49 print(result); |
| 49 expect(result.valueAsString, equals('Klass')); | 50 expect(result.valueAsString, equals('Klass')); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 73 expect(result.valueAsString, equals('Klass')); | 74 expect(result.valueAsString, equals('Klass')); |
| 74 | 75 |
| 75 // function.Owner verus function.Origin | 76 // function.Owner verus function.Origin |
| 76 // The mixin of Superclass is in _other.dart and the mixin | 77 // The mixin of Superclass is in _other.dart and the mixin |
| 77 // application is in _test.dart. | 78 // application is in _test.dart. |
| 78 result = await isolate.evalFrame(topFrame, 'topLevel'); | 79 result = await isolate.evalFrame(topFrame, 'topLevel'); |
| 79 print(result); | 80 print(result); |
| 80 expect(result.valueAsString, equals('OtherLibrary')); | 81 expect(result.valueAsString, equals('OtherLibrary')); |
| 81 } | 82 } |
| 82 | 83 |
| 83 main(args) => runIsolateTests(args, [testerDo], testeeConcurrent:testeeDo); | 84 main(args) => runIsolateTests(args, [testerDo], testeeConcurrent: testeeDo); |
| OLD | NEW |