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

Unified Diff: tests/compiler/dart2js/resolver_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: Created 7 years, 6 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/resolver_test.dart
diff --git a/tests/compiler/dart2js/resolver_test.dart b/tests/compiler/dart2js/resolver_test.dart
index dcdcc070919b5386c606a65aee86a8e0d309f712..28d97c138e47b78776b45f28267cf32e1825d207 100644
--- a/tests/compiler/dart2js/resolver_test.dart
+++ b/tests/compiler/dart2js/resolver_test.dart
@@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
import "package:expect/expect.dart";
+import 'dart:async';
import 'dart:collection';
import "../../../sdk/lib/_internal/compiler/implementation/resolution/resolution.dart";
@@ -783,11 +784,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) {
@@ -800,9 +802,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'));
+ compileScript(script).then((compiler) {
+ checkMemberResolved(compiler, 'C', buildSourceString('toString'));
+ });
}
operatorName(op, isUnary) {
@@ -816,10 +818,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));
+ compileScript(script).then((compiler) {
+ checkMemberResolved(compiler, 'C', operatorName('[]', false));
+ checkMemberResolved(compiler, 'C', operatorName('[]=', false));
+ });
}
testIncrementsAndDecrements() {
@@ -838,10 +840,10 @@ 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));
+ compileScript(script).then((compiler) {
+ checkMemberResolved(compiler, 'A', operatorName('+', false));
+ checkMemberResolved(compiler, 'B', operatorName('+', false));
+ checkMemberResolved(compiler, 'C', operatorName('-', false));
+ checkMemberResolved(compiler, 'D', operatorName('-', false));
+ });
}

Powered by Google App Engine
This is Rietveld 408576698