| Index: runtime/tests/vm/dart/isolate_mirror_local_test.dart
|
| diff --git a/runtime/tests/vm/dart/isolate_mirror_local_test.dart b/runtime/tests/vm/dart/isolate_mirror_local_test.dart
|
| index b07be27c28113281bd8d3cc70270736ab9b80765..01ffb1d1ae41abf40e939a7872aeabe99de47c9b 100644
|
| --- a/runtime/tests/vm/dart/isolate_mirror_local_test.dart
|
| +++ b/runtime/tests/vm/dart/isolate_mirror_local_test.dart
|
| @@ -121,7 +121,7 @@ void testRootLibraryMirror(LibraryMirror lib_mirror) {
|
|
|
| // Test library invocation by calling function(123).
|
| Expect.equals(0, global_var);
|
| - lib_mirror.invokeAsync(const Symbol('function'), [123]).then(
|
| + new Future(()=>lib_mirror.invoke(const Symbol('function'), [123])).then(
|
| (InstanceMirror retval) {
|
| Expect.equals(123, global_var);
|
| Expect.equals(const Symbol('int'), retval.type.simpleName);
|
| @@ -313,7 +313,6 @@ void testLibrariesMap(Map libraries) {
|
| Expect.isFalse(list_intf.isPrivate);
|
| Expect.equals(const Symbol('Object'), list_intf.superclass.simpleName);
|
| Expect.equals(const Symbol('dart.core'), list_intf.owner.simpleName);
|
| - Expect.isTrue(list_intf.isClass);
|
| Expect.equals(const Symbol('Iterable'),
|
| list_intf.superinterfaces[0].simpleName);
|
| Expect.equals("ClassMirror on 'List'", list_intf.toString());
|
| @@ -326,9 +325,7 @@ void testLibrariesMap(Map libraries) {
|
| oom_cls.qualifiedName);
|
| Expect.isFalse(oom_cls.isPrivate);
|
| Expect.equals(const Symbol('Object'), oom_cls.superclass.simpleName);
|
| - Expect.isTrue(oom_cls.defaultFactory == null);
|
| Expect.equals(const Symbol('dart.core'), oom_cls.owner.simpleName);
|
| - Expect.isTrue(oom_cls.isClass);
|
| Expect.equals(const Symbol('Error'), oom_cls.superinterfaces[0].simpleName);
|
| Expect.equals("ClassMirror on 'OutOfMemoryError'",
|
| oom_cls.toString());
|
| @@ -355,7 +352,7 @@ void testIntegerInstanceMirror(InstanceMirror mirror) {
|
| Expect.equals("InstanceMirror on 1001", mirror.toString());
|
|
|
| // Invoke (mirror + mirror).
|
| - mirror.invokeAsync(const Symbol('+'), [ mirror ]).then(
|
| + new Future(()=>mirror.invoke(const Symbol('+'), [ mirror.reflectee ])).then(
|
| (InstanceMirror retval) {
|
| Expect.equals(const Symbol('int'), retval.type.simpleName);
|
| Expect.isTrue(retval.hasReflectee);
|
| @@ -372,7 +369,7 @@ void testStringInstanceMirror(InstanceMirror mirror) {
|
| mirror.toString());
|
|
|
| // Invoke mirror[0].
|
| - mirror.invokeAsync(const Symbol('[]'), [ 0 ]).then(
|
| + new Future(()=>mirror.invoke(const Symbol('[]'), [ 0 ])).then(
|
| (InstanceMirror retval) {
|
| Expect.equals(const Symbol('String'), retval.type.simpleName);
|
| Expect.isTrue(retval.hasReflectee);
|
| @@ -437,10 +434,8 @@ void testCustomInstanceMirror(InstanceMirror mirror) {
|
| Expect.isTrue(cls is ClassMirror);
|
| Expect.equals(const Symbol('MyClass'), cls.simpleName);
|
| Expect.equals(const Symbol('MySuperClass'), cls.superclass.simpleName);
|
| - Expect.isTrue(cls.defaultFactory == null);
|
| Expect.equals(const Symbol('isolate_mirror_local_test'),
|
| cls.owner.simpleName);
|
| - Expect.isTrue(cls.isClass);
|
| Expect.equals(const Symbol('MyInterface'), cls.superinterfaces[0].simpleName);
|
| Expect.throws(() => cls.metadata,
|
| (e) => e is MirroredCompilationError,
|
| @@ -448,7 +443,7 @@ void testCustomInstanceMirror(InstanceMirror mirror) {
|
| Expect.equals("ClassMirror on 'MyClass'", cls.toString());
|
|
|
| // Invoke mirror.method(1000).
|
| - mirror.invokeAsync(const Symbol('method'), [ 1000 ]).then(
|
| + new Future(()=>mirror.invoke(const Symbol('method'), [ 1000 ])).then(
|
| (InstanceMirror retval) {
|
| Expect.equals(const Symbol('int'), retval.type.simpleName);
|
| Expect.isTrue(retval.hasReflectee);
|
| @@ -476,7 +471,7 @@ void methodWithError() {
|
| void testMirrorErrors(MirrorSystem mirrors) {
|
| LibraryMirror lib_mirror = mirrors.isolate.rootLibrary;
|
|
|
| - lib_mirror.invokeAsync(const Symbol('methodWithException'), [])
|
| + new Future(()=>lib_mirror.invoke(const Symbol('methodWithException'), []))
|
| .then((InstanceMirror retval) {
|
| // Should not reach here.
|
| Expect.isTrue(false);
|
| @@ -488,7 +483,7 @@ void testMirrorErrors(MirrorSystem mirrors) {
|
| testDone('testMirrorErrors1');
|
| });
|
|
|
| - lib_mirror.invokeAsync(const Symbol('methodWithError'), [])
|
| + new Future(()=>lib_mirror.invoke(const Symbol('methodWithError'), []))
|
| .then((InstanceMirror retval) {
|
| // Should not reach here.
|
| Expect.isTrue(false);
|
| @@ -502,7 +497,7 @@ void testMirrorErrors(MirrorSystem mirrors) {
|
| // TODO(turnidge): When we call a method that doesn't exist, we
|
| // should probably call noSuchMethod(). I'm adding this test to
|
| // document the current behavior in the meantime.
|
| - lib_mirror.invokeAsync(const Symbol('methodNotFound'), [])
|
| + new Future(()=>lib_mirror.invoke(const Symbol('methodNotFound'), []))
|
| .then((InstanceMirror retval) {
|
| // Should not reach here.
|
| Expect.isTrue(false);
|
| @@ -531,8 +526,7 @@ void main() {
|
| 'testMirrorErrors2',
|
| 'testMirrorErrors3']);
|
|
|
| - // Test that an isolate can reflect on itself.
|
| - mirrorSystemOf(exit_port.toSendPort()).then(testMirrorSystem);
|
| + testMirrorSystem(currentMirrorSystem());
|
|
|
| testIntegerInstanceMirror(reflect(1001));
|
| testStringInstanceMirror(reflect('This\nis\na\nString'));
|
|
|