Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(360)

Unified Diff: tests/compiler/dart2js/list_tracer_test.dart

Issue 17759007: First pass at asynchronous input loading in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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());
+ }
+ }));
}
« no previous file with comments | « tests/compiler/dart2js/list_tracer_node_type_test.dart ('k') | tests/compiler/dart2js/lookup_member_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698