| 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'; |
| 11 import 'test_helper.dart'; | 11 import 'test_helper.dart'; |
| 12 import 'service_test_common.dart'; | 12 import 'service_test_common.dart'; |
| 13 | 13 |
| 14 import 'evaluate_activation_in_method_class_other.dart'; | 14 import 'evaluate_activation_in_method_class_other.dart'; |
| 15 | 15 |
| 16 var topLevel = "TestLibrary"; | 16 var topLevel = "TestLibrary"; |
| 17 | 17 |
| 18 class Subclass extends Superclass with Klass { | 18 class Subclass extends Superclass with Klass { |
| 19 var _instVar = 'Subclass'; | 19 var _instVar = 'Subclass'; |
| 20 var instVar = 'Subclass'; | 20 var instVar = 'Subclass'; |
| 21 method() => 'Subclass'; | 21 method() => 'Subclass'; |
| 22 static staticMethod() => 'Subclass'; | 22 static staticMethod() => 'Subclass'; |
| 23 suppress_warning() => _instVar; |
| 23 } | 24 } |
| 24 | 25 |
| 25 testeeDo() { | 26 testeeDo() { |
| 26 var obj = new Subclass(); | 27 var obj = new Subclass(); |
| 27 obj.test(); | 28 obj.test(); |
| 28 } | 29 } |
| 29 | 30 |
| 30 testerDo(Isolate isolate) async { | 31 testerDo(Isolate isolate) async { |
| 31 await hasStoppedAtBreakpoint(isolate); | 32 await hasStoppedAtBreakpoint(isolate); |
| 32 | 33 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 63 print(result); | 64 print(result); |
| 64 expect(result.valueAsString, equals('Superclass')); | 65 expect(result.valueAsString, equals('Superclass')); |
| 65 | 66 |
| 66 result = await isolate.evalFrame(topFrame, 'super.method()'); | 67 result = await isolate.evalFrame(topFrame, 'super.method()'); |
| 67 print(result); | 68 print(result); |
| 68 expect(result.valueAsString, equals('Superclass')); | 69 expect(result.valueAsString, equals('Superclass')); |
| 69 | 70 |
| 70 result = await isolate.evalFrame(topFrame, 'staticMethod()'); | 71 result = await isolate.evalFrame(topFrame, 'staticMethod()'); |
| 71 print(result); | 72 print(result); |
| 72 expect(result.valueAsString, equals('Klass')); | 73 expect(result.valueAsString, equals('Klass')); |
| 73 | 74 |
| 74 // function.Owner verus function.Origin | 75 // function.Owner verus function.Origin |
| 75 // The mixin of Superclass is in _other.dart and the mixin | 76 // The mixin of Superclass is in _other.dart and the mixin |
| 76 // application is in _test.dart. | 77 // application is in _test.dart. |
| 77 result = await isolate.evalFrame(topFrame, 'topLevel'); | 78 result = await isolate.evalFrame(topFrame, 'topLevel'); |
| 78 print(result); | 79 print(result); |
| 79 expect(result.valueAsString, equals('OtherLibrary')); | 80 expect(result.valueAsString, equals('OtherLibrary')); |
| 80 } | 81 } |
| 81 | 82 |
| 82 main(args) => runIsolateTests(args, [testerDo], testeeConcurrent:testeeDo); | 83 main(args) => runIsolateTests(args, [testerDo], testeeConcurrent:testeeDo); |
| OLD | NEW |