| Index: runtime/observatory/tests/service/weak_properties_test.dart
|
| diff --git a/runtime/observatory/tests/service/weak_properties_test.dart b/runtime/observatory/tests/service/weak_properties_test.dart
|
| index cdcb6451da1f4fab709916e6d525a16b1647a362..30ae2a033535d96cfc160073c2d7d1ed2a649cf9 100644
|
| --- a/runtime/observatory/tests/service/weak_properties_test.dart
|
| +++ b/runtime/observatory/tests/service/weak_properties_test.dart
|
| @@ -34,30 +34,32 @@ void script() {
|
|
|
| var tests = [
|
|
|
| -(Isolate isolate) =>
|
| - isolate.rootLibrary.load().then((Library lib) {
|
| + (Isolate isolate) async {
|
| + var lib = await isolate.rootLibrary.load();
|
| Field keyField = lib.variables.singleWhere((v) => v.name == 'key');
|
| - Instance key = keyField.value;
|
| + await keyField.load();
|
| + Instance key = keyField.staticValue;
|
| Field valueField = lib.variables.singleWhere((v) => v.name == 'value');
|
| - Instance value = valueField.value;
|
| + await valueField.load();
|
| + Instance value = valueField.staticValue;
|
| Field propField = lib.variables.singleWhere((v) => v.name == 'weak_property');
|
| - Instance prop = propField.value;
|
| + await propField.load();
|
| + Instance prop = propField.staticValue;
|
|
|
| expect(key.isWeakProperty, isFalse);
|
| expect(value.isWeakProperty, isFalse);
|
| expect(prop.isWeakProperty, isTrue);
|
| expect(prop.key, isNull);
|
| expect(prop.value, isNull);
|
| - return prop.load().then((Instance loadedProp) {
|
| - // Object ids are not cannonicalized, so we rely on the key and value
|
| - // being the sole instances of their classes to test we got the objects
|
| - // we expect.
|
| - expect(loadedProp.key, isNotNull);
|
| - expect(loadedProp.key.clazz, equals(key.clazz));
|
| - expect(loadedProp.value, isNotNull);
|
| - expect(loadedProp.value.clazz, equals(value.clazz));
|
| - });
|
| - }),
|
| + Instance loadedProp = await prop.load();
|
| + // Object ids are not cannonicalized, so we rely on the key and value
|
| + // being the sole instances of their classes to test we got the objects
|
| + // we expect.
|
| + expect(loadedProp.key, isNotNull);
|
| + expect(loadedProp.key.clazz, equals(key.clazz));
|
| + expect(loadedProp.value, isNotNull);
|
| + expect(loadedProp.value.clazz, equals(value.clazz));
|
| + },
|
|
|
| ];
|
|
|
|
|