Index: runtime/observatory/tests/service/contexts_test.dart |
diff --git a/runtime/observatory/tests/service/contexts_test.dart b/runtime/observatory/tests/service/contexts_test.dart |
index 6bbcacde2f3353c1de9c36cd6ab5eb3d940d9ad9..6b3e8c9c3330c3258b06c4266d0e2acb28d83fe1 100644 |
--- a/runtime/observatory/tests/service/contexts_test.dart |
+++ b/runtime/observatory/tests/service/contexts_test.dart |
@@ -53,12 +53,14 @@ var tests = [ |
(Isolate isolate) => |
isolate.rootLibrary.load().then((Library lib) { |
Field field = lib.variables.singleWhere((v) => v.name == 'cleanBlock'); |
- return field.value.load().then((Instance block) { |
- expect(block.isClosure, isTrue); |
- expect(block.context.isContext, isTrue); |
- expect(block.context.length, equals(0)); |
- return block.context.load().then((Context ctxt) { |
- expect(ctxt.parentContext.isNull, isTrue); |
+ return field.load().then((_) { |
+ return field.staticValue.load().then((Instance block) { |
+ expect(block.isClosure, isTrue); |
+ expect(block.context.isContext, isTrue); |
+ expect(block.context.length, equals(0)); |
+ return block.context.load().then((Context ctxt) { |
+ expect(ctxt.parentContext.isNull, isTrue); |
+ }); |
}); |
}); |
}), |
@@ -66,17 +68,19 @@ var tests = [ |
(Isolate isolate) => |
isolate.rootLibrary.load().then((Library lib) { |
Field field = lib.variables.singleWhere((v) => v.name == 'copyingBlock'); |
- return field.value.load().then((Instance block) { |
- expect(block.isClosure, isTrue); |
- expect(block.context.isContext, isTrue); |
- expect(block.context.length, equals(1)); |
- return block.context.load().then((Context ctxt) { |
- expect(ctxt.variables.single['value'].isString, isTrue); |
- expect(ctxt.variables.single['value'].valueAsString, equals('I could be copied into the block')); |
- expect(ctxt.parentContext.isContext, isTrue); |
- expect(ctxt.parentContext.length, equals(0)); |
- return ctxt.parentContext.load().then((Context outerCtxt) { |
- expect(outerCtxt.parentContext.isNull, isTrue); |
+ return field.load().then((_) { |
+ return field.staticValue.load().then((Instance block) { |
+ expect(block.isClosure, isTrue); |
+ expect(block.context.isContext, isTrue); |
+ expect(block.context.length, equals(1)); |
+ return block.context.load().then((Context ctxt) { |
+ expect(ctxt.variables.single['value'].isString, isTrue); |
+ expect(ctxt.variables.single['value'].valueAsString, equals('I could be copied into the block')); |
+ expect(ctxt.parentContext.isContext, isTrue); |
+ expect(ctxt.parentContext.length, equals(0)); |
+ return ctxt.parentContext.load().then((Context outerCtxt) { |
+ expect(outerCtxt.parentContext.isNull, isTrue); |
+ }); |
}); |
}); |
}); |
@@ -85,17 +89,19 @@ var tests = [ |
(Isolate isolate) => |
isolate.rootLibrary.load().then((Library lib) { |
Field field = lib.variables.singleWhere((v) => v.name == 'fullBlock'); |
- return field.value.load().then((Instance block) { |
- expect(block.isClosure, isTrue); |
- expect(block.context.isContext, isTrue); |
- expect(block.context.length, equals(1)); |
- return block.context.load().then((ctxt) { |
- expect(ctxt.variables.single['value'].isInt, isTrue); |
- expect(ctxt.variables.single['value'].valueAsString, equals('43')); |
- expect(ctxt.parentContext.isContext, isTrue); |
- expect(ctxt.parentContext.length, equals(0)); |
- return ctxt.parentContext.load().then((Context outerCtxt) { |
- expect(outerCtxt.parentContext.isNull, isTrue); |
+ return field.load().then((_) { |
+ return field.staticValue.load().then((Instance block) { |
+ expect(block.isClosure, isTrue); |
+ expect(block.context.isContext, isTrue); |
+ expect(block.context.length, equals(1)); |
+ return block.context.load().then((ctxt) { |
+ expect(ctxt.variables.single['value'].isInt, isTrue); |
+ expect(ctxt.variables.single['value'].valueAsString, equals('43')); |
+ expect(ctxt.parentContext.isContext, isTrue); |
+ expect(ctxt.parentContext.length, equals(0)); |
+ return ctxt.parentContext.load().then((Context outerCtxt) { |
+ expect(outerCtxt.parentContext.isNull, isTrue); |
+ }); |
}); |
}); |
}); |
@@ -104,22 +110,24 @@ var tests = [ |
(Isolate isolate) => |
isolate.rootLibrary.load().then((Library lib) { |
Field field = lib.variables.singleWhere((v) => v.name == 'fullBlockWithChain'); |
- return field.value.load().then((Instance block) { |
- expect(block.isClosure, isTrue); |
- expect(block.context.isContext, isTrue); |
- expect(block.context.length, equals(1)); |
- return block.context.load().then((Context ctxt) { |
- expect(ctxt.variables.single['value'].isInt, isTrue); |
- expect(ctxt.variables.single['value'].valueAsString, equals('4201')); |
- expect(ctxt.parentContext.isContext, isTrue); |
- expect(ctxt.parentContext.length, equals(1)); |
- return ctxt.parentContext.load().then((Context outerCtxt) { |
- expect(outerCtxt.variables.single['value'].isInt, isTrue); |
- expect(outerCtxt.variables.single['value'].valueAsString, equals('421')); |
- expect(outerCtxt.parentContext.isContext, isTrue); |
- expect(outerCtxt.parentContext.length, equals(0)); |
- return outerCtxt.parentContext.load().then((Context outerCtxt2) { |
- expect(outerCtxt2.parentContext.isNull, isTrue); |
+ return field.load().then((_) { |
+ return field.staticValue.load().then((Instance block) { |
+ expect(block.isClosure, isTrue); |
+ expect(block.context.isContext, isTrue); |
+ expect(block.context.length, equals(1)); |
+ return block.context.load().then((Context ctxt) { |
+ expect(ctxt.variables.single['value'].isInt, isTrue); |
+ expect(ctxt.variables.single['value'].valueAsString, equals('4201')); |
+ expect(ctxt.parentContext.isContext, isTrue); |
+ expect(ctxt.parentContext.length, equals(1)); |
+ return ctxt.parentContext.load().then((Context outerCtxt) { |
+ expect(outerCtxt.variables.single['value'].isInt, isTrue); |
+ expect(outerCtxt.variables.single['value'].valueAsString, equals('421')); |
+ expect(outerCtxt.parentContext.isContext, isTrue); |
+ expect(outerCtxt.parentContext.length, equals(0)); |
+ return outerCtxt.parentContext.load().then((Context outerCtxt2) { |
+ expect(outerCtxt2.parentContext.isNull, isTrue); |
+ }); |
}); |
}); |
}); |