Index: tests/compiler/dart2js/resolver_test.dart |
diff --git a/tests/compiler/dart2js/resolver_test.dart b/tests/compiler/dart2js/resolver_test.dart |
index 8587e3e03c471553a5736426f2100abd7d848923..0a1a9dd41bf06e39267fd30dc1848a3bb56d49b7 100644 |
--- a/tests/compiler/dart2js/resolver_test.dart |
+++ b/tests/compiler/dart2js/resolver_test.dart |
@@ -3,6 +3,8 @@ |
// BSD-style license that can be found in the LICENSE file. |
import "package:expect/expect.dart"; |
+import 'dart:async'; |
+import "package:async_helper/async_helper.dart"; |
import 'dart:collection'; |
import "../../../sdk/lib/_internal/compiler/implementation/resolution/resolution.dart"; |
@@ -841,11 +843,12 @@ List<String> asSortedStrings(Link link) { |
return result; |
} |
-compileScript(String source) { |
+Future compileScript(String source) { |
Uri uri = new Uri(scheme: 'source'); |
MockCompiler compiler = compilerFor(source, uri); |
- compiler.runCompiler(uri); |
- return compiler; |
+ return compiler.runCompiler(uri).then((_) { |
+ return compiler; |
+ }); |
} |
checkMemberResolved(compiler, className, memberName) { |
@@ -858,9 +861,9 @@ checkMemberResolved(compiler, className, memberName) { |
testToString() { |
final script = r"class C { toString() => 'C'; } main() { '${new C()}'; }"; |
- final compiler = compileScript(script); |
- |
- checkMemberResolved(compiler, 'C', buildSourceString('toString')); |
+ asyncTest(() => compileScript(script).then((compiler) { |
+ checkMemberResolved(compiler, 'C', buildSourceString('toString')); |
+ })); |
} |
operatorName(op, isUnary) { |
@@ -874,10 +877,10 @@ testIndexedOperator() { |
operator[]=(ix, v) {} |
} |
main() { var c = new C(); c[0]++; }"""; |
- final compiler = compileScript(script); |
- |
- checkMemberResolved(compiler, 'C', operatorName('[]', false)); |
- checkMemberResolved(compiler, 'C', operatorName('[]=', false)); |
+ asyncTest(() => compileScript(script).then((compiler) { |
+ checkMemberResolved(compiler, 'C', operatorName('[]', false)); |
+ checkMemberResolved(compiler, 'C', operatorName('[]=', false)); |
+ })); |
} |
testIncrementsAndDecrements() { |
@@ -896,12 +899,12 @@ testIncrementsAndDecrements() { |
var d = new D(); |
--d; |
}"""; |
- final compiler = compileScript(script); |
- |
- checkMemberResolved(compiler, 'A', operatorName('+', false)); |
- checkMemberResolved(compiler, 'B', operatorName('+', false)); |
- checkMemberResolved(compiler, 'C', operatorName('-', false)); |
- checkMemberResolved(compiler, 'D', operatorName('-', false)); |
+ asyncTest(() => compileScript(script).then((compiler) { |
+ checkMemberResolved(compiler, 'A', operatorName('+', false)); |
+ checkMemberResolved(compiler, 'B', operatorName('+', false)); |
+ checkMemberResolved(compiler, 'C', operatorName('-', false)); |
+ checkMemberResolved(compiler, 'D', operatorName('-', false)); |
+ })); |
} |
testOverrideHashCodeCheck() { |
@@ -916,9 +919,10 @@ testOverrideHashCodeCheck() { |
main() { |
new A() == new B(); |
}"""; |
- final compiler = compileScript(script); |
- Expect.equals(1, compiler.warnings.length); |
- Expect.equals(MessageKind.OVERRIDE_EQUALS_NOT_HASH_CODE, |
- compiler.warnings[0].message.kind); |
- Expect.equals(0, compiler.errors.length); |
+ asyncTest(() => compileScript(script).then((compiler) { |
+ Expect.equals(1, compiler.warnings.length); |
+ Expect.equals(MessageKind.OVERRIDE_EQUALS_NOT_HASH_CODE, |
+ compiler.warnings[0].message.kind); |
+ Expect.equals(0, compiler.errors.length); |
+ })); |
} |