Index: tests/compiler/dart2js/type_test_helper.dart |
diff --git a/tests/compiler/dart2js/type_test_helper.dart b/tests/compiler/dart2js/type_test_helper.dart |
index db1a43f8a95153a5fbaaba5a173903dd09a89160..5a21201d9da189bbd018ac91fa807a430390f329 100644 |
--- a/tests/compiler/dart2js/type_test_helper.dart |
+++ b/tests/compiler/dart2js/type_test_helper.dart |
@@ -4,6 +4,7 @@ |
library type_test_helper; |
+import 'dart:async'; |
import "package:expect/expect.dart"; |
import '../../../sdk/lib/_internal/compiler/implementation/dart_types.dart'; |
import "parser_helper.dart" show SourceString; |
@@ -22,7 +23,7 @@ GenericType instantiate(TypeDeclarationElement element, |
class TypeEnvironment { |
final MockCompiler compiler; |
- factory TypeEnvironment(String source) { |
+ static Future<TypeEnvironment> create(String source) { |
var uri = new Uri(scheme: 'source'); |
MockCompiler compiler = compilerFor(''' |
main() {} |
@@ -30,8 +31,9 @@ class TypeEnvironment { |
uri, |
analyzeAll: true, |
analyzeOnly: true); |
- compiler.runCompiler(uri); |
- return new TypeEnvironment._(compiler); |
+ return compiler.runCompiler(uri).then((_) { |
+ return new TypeEnvironment._(compiler); |
+ }); |
} |
TypeEnvironment._(MockCompiler this.compiler); |