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

Unified Diff: tests/compiler/dart2js/concrete_type_inference_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
« no previous file with comments | « tests/compiler/dart2js/compiler_helper.dart ('k') | tests/compiler/dart2js/cpa_inference_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/concrete_type_inference_test.dart
diff --git a/tests/compiler/dart2js/concrete_type_inference_test.dart b/tests/compiler/dart2js/concrete_type_inference_test.dart
index fe95c4962a532f5bd75fed0347b7be1e66a16014..36d6f0ad1effad07e607a7ee3c0e0b8af2708947 100644
--- a/tests/compiler/dart2js/concrete_type_inference_test.dart
+++ b/tests/compiler/dart2js/concrete_type_inference_test.dart
@@ -2,21 +2,24 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+import 'dart:async';
import "package:expect/expect.dart";
+import "package:async_helper/async_helper.dart";
import 'compiler_helper.dart';
import 'parser_helper.dart';
-void compileAndFind(String code, String name,
+Future compileAndFind(String code, String name,
check(compiler, element)) {
Uri uri = new Uri(scheme: 'source');
var compiler = compilerFor(code, uri);
- compiler.runCompiler(uri);
- var element = findElement(compiler, name);
- return check(compiler, element);
+ return compiler.runCompiler(uri).then((_) {
+ var element = findElement(compiler, name);
+ check(compiler, element);
+ });
}
void checkPrintType(String expression, checkType(compiler, type)) {
- compileAndFind(
+ asyncTest(() => compileAndFind(
'main() { print($expression); }',
'print',
(compiler, printElement) {
@@ -24,9 +27,9 @@ void checkPrintType(String expression, checkType(compiler, type)) {
printElement.computeSignature(compiler).requiredParameters.head;
var type = compiler.typesTask.getGuaranteedTypeOfElement(parameter);
checkType(compiler, type);
- });
+ }));
- compileAndFind(
+ asyncTest(() => compileAndFind(
'main() { var x = print; print($expression); }',
'print',
(compiler, printElement) {
@@ -36,9 +39,9 @@ void checkPrintType(String expression, checkType(compiler, type)) {
var inferrer = compiler.typesTask.typesInferrer;
Expect.identical(compiler.typesTask.dynamicType,
type.simplify(compiler));
- });
+ }));
- compileAndFind(
+ asyncTest(() => compileAndFind(
'main() { print($expression); print($expression); }',
'print',
(compiler, printElement) {
@@ -46,7 +49,7 @@ void checkPrintType(String expression, checkType(compiler, type)) {
printElement.computeSignature(compiler).requiredParameters.head;
var type = compiler.typesTask.getGuaranteedTypeOfElement(parameter);
checkType(compiler, type);
- });
+ }));
}
void testBasicTypes() {
« no previous file with comments | « tests/compiler/dart2js/compiler_helper.dart ('k') | tests/compiler/dart2js/cpa_inference_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698