| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 | 4 |
| 5 library inbound_references_test; | 5 library inbound_references_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'package:observatory/service_io.dart'; | 8 import 'package:observatory/service_io.dart'; |
| 9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
| 10 import 'test_helper.dart'; | 10 import 'test_helper.dart'; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 (Isolate isolate) => | 66 (Isolate isolate) => |
| 67 isolate.rootLib.load().then((Library lib) { | 67 isolate.rootLib.load().then((Library lib) { |
| 68 ServiceMap field = lib.variables.singleWhere((v) => v.name == 'copyingBlock'
); | 68 ServiceMap field = lib.variables.singleWhere((v) => v.name == 'copyingBlock'
); |
| 69 return field['value'].load().then((Instance block) { | 69 return field['value'].load().then((Instance block) { |
| 70 expect(block.isClosure, isTrue); | 70 expect(block.isClosure, isTrue); |
| 71 expect(block.closureCtxt.isContext, isTrue); | 71 expect(block.closureCtxt.isContext, isTrue); |
| 72 expect(block.closureCtxt.length, equals(1)); | 72 expect(block.closureCtxt.length, equals(1)); |
| 73 return block.closureCtxt.load().then((Context ctxt) { | 73 return block.closureCtxt.load().then((Context ctxt) { |
| 74 expect(ctxt.variables.single['value'].isString, isTrue); | 74 expect(ctxt.variables.single['value'].isString, isTrue); |
| 75 expect(ctxt.variables.single['value'].valueAsString, equals('"I could be
copied into the block"')); | 75 expect(ctxt.variables.single['value'].valueAsString, equals('I could be
copied into the block')); |
| 76 expect(block.closureCtxt.parentContext.isNull, isTrue); | 76 expect(block.closureCtxt.parentContext.isNull, isTrue); |
| 77 }); | 77 }); |
| 78 }); | 78 }); |
| 79 }), | 79 }), |
| 80 | 80 |
| 81 (Isolate isolate) => | 81 (Isolate isolate) => |
| 82 isolate.rootLib.load().then((Library lib) { | 82 isolate.rootLib.load().then((Library lib) { |
| 83 ServiceMap field = lib.variables.singleWhere((v) => v.name == 'fullBlock'); | 83 ServiceMap field = lib.variables.singleWhere((v) => v.name == 'fullBlock'); |
| 84 return field['value'].load().then((Instance block) { | 84 return field['value'].load().then((Instance block) { |
| 85 expect(block.isClosure, isTrue); | 85 expect(block.isClosure, isTrue); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 110 expect(outerCtxt.variables.single['value'].valueAsString, equals('421'
)); | 110 expect(outerCtxt.variables.single['value'].valueAsString, equals('421'
)); |
| 111 expect(outerCtxt.parentContext.isNull, isTrue); | 111 expect(outerCtxt.parentContext.isNull, isTrue); |
| 112 }); | 112 }); |
| 113 }); | 113 }); |
| 114 }); | 114 }); |
| 115 }), | 115 }), |
| 116 | 116 |
| 117 ]; | 117 ]; |
| 118 | 118 |
| 119 main(args) => runIsolateTests(args, tests, testeeBefore: script); | 119 main(args) => runIsolateTests(args, tests, testeeBefore: script); |
| OLD | NEW |