Index: tests/compiler/dart2js/list_tracer_test.dart |
diff --git a/tests/compiler/dart2js/list_tracer_test.dart b/tests/compiler/dart2js/list_tracer_test.dart |
index c9b979123e2f7292c5982c0db54e429651e7f679..936dd17667e9ff6b708c46c37bd67b8570b7a154 100644 |
--- a/tests/compiler/dart2js/list_tracer_test.dart |
+++ b/tests/compiler/dart2js/list_tracer_test.dart |
@@ -3,6 +3,7 @@ |
// BSD-style license that can be found in the LICENSE file. |
import 'package:expect/expect.dart'; |
+import "package:async_helper/async_helper.dart"; |
import |
'../../../sdk/lib/_internal/compiler/implementation/types/types.dart' |
show ContainerTypeMask, TypeMask; |
@@ -189,43 +190,44 @@ void main() { |
void doTest(String allocation, {bool nullify}) { |
Uri uri = new Uri(scheme: 'source'); |
var compiler = compilerFor(generateTest(allocation), uri); |
- compiler.runCompiler(uri); |
- var typesTask = compiler.typesTask; |
- var typesInferrer = typesTask.typesInferrer; |
- |
- checkType(String name, type) { |
- var element = findElement(compiler, name); |
- ContainerTypeMask mask = typesInferrer.getTypeOfElement(element); |
- if (nullify) type = type.nullable(); |
- Expect.equals(type, mask.elementType.simplify(compiler), name); |
- } |
+ asyncTest(() => compiler.runCompiler(uri).then((_) { |
+ var typesTask = compiler.typesTask; |
+ var typesInferrer = typesTask.typesInferrer; |
+ |
+ checkType(String name, type) { |
+ var element = findElement(compiler, name); |
+ ContainerTypeMask mask = typesInferrer.getTypeOfElement(element); |
+ if (nullify) type = type.nullable(); |
+ Expect.equals(type, mask.elementType.simplify(compiler), name); |
+ } |
- checkType('listInField', typesTask.numType); |
- checkType('listPassedToMethod', typesTask.numType); |
- checkType('listReturnedFromMethod', typesTask.numType); |
- checkType('listUsedWithCascade', typesTask.numType); |
- checkType('listUsedInClosure', typesTask.numType); |
- checkType('listPassedToSelector', typesTask.numType); |
- checkType('listReturnedFromSelector', typesTask.numType); |
- checkType('listUsedWithAddAndInsert', typesTask.numType); |
- checkType('listUsedWithConstraint', typesTask.numType); |
- checkType('listEscapingFromSetter', typesTask.numType); |
- checkType('listUsedInLocal', typesTask.numType); |
- checkType('listEscapingInSetterValue', typesTask.numType); |
- checkType('listEscapingInIndex', typesTask.numType); |
- checkType('listEscapingInIndexSet', typesTask.intType); |
- checkType('listEscapingTwiceInIndexSet', typesTask.numType); |
- checkType('listSetInNonFinalField', typesTask.numType); |
- checkType('listWithChangedLength', typesTask.intType.nullable()); |
- |
- checkType('listPassedToClosure', typesTask.dynamicType); |
- checkType('listReturnedFromClosure', typesTask.dynamicType); |
- checkType('listUsedWithNonOkSelector', typesTask.dynamicType); |
- checkType('listPassedAsOptionalParameter', typesTask.dynamicType); |
- checkType('listPassedAsNamedParameter', typesTask.dynamicType); |
- |
- if (!allocation.contains('filled')) { |
- checkType('listUnset', new TypeMask.nonNullEmpty()); |
- checkType('listOnlySetWithConstraint', new TypeMask.nonNullEmpty()); |
- } |
+ checkType('listInField', typesTask.numType); |
+ checkType('listPassedToMethod', typesTask.numType); |
+ checkType('listReturnedFromMethod', typesTask.numType); |
+ checkType('listUsedWithCascade', typesTask.numType); |
+ checkType('listUsedInClosure', typesTask.numType); |
+ checkType('listPassedToSelector', typesTask.numType); |
+ checkType('listReturnedFromSelector', typesTask.numType); |
+ checkType('listUsedWithAddAndInsert', typesTask.numType); |
+ checkType('listUsedWithConstraint', typesTask.numType); |
+ checkType('listEscapingFromSetter', typesTask.numType); |
+ checkType('listUsedInLocal', typesTask.numType); |
+ checkType('listEscapingInSetterValue', typesTask.numType); |
+ checkType('listEscapingInIndex', typesTask.numType); |
+ checkType('listEscapingInIndexSet', typesTask.intType); |
+ checkType('listEscapingTwiceInIndexSet', typesTask.numType); |
+ checkType('listSetInNonFinalField', typesTask.numType); |
+ checkType('listWithChangedLength', typesTask.intType.nullable()); |
+ |
+ checkType('listPassedToClosure', typesTask.dynamicType); |
+ checkType('listReturnedFromClosure', typesTask.dynamicType); |
+ checkType('listUsedWithNonOkSelector', typesTask.dynamicType); |
+ checkType('listPassedAsOptionalParameter', typesTask.dynamicType); |
+ checkType('listPassedAsNamedParameter', typesTask.dynamicType); |
+ |
+ if (!allocation.contains('filled')) { |
+ checkType('listUnset', new TypeMask.nonNullEmpty()); |
+ checkType('listOnlySetWithConstraint', new TypeMask.nonNullEmpty()); |
+ } |
+ })); |
} |