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

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: 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/resolution_test.dart ('k') | tests/compiler/dart2js/rewrite_better_user_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/resolver_test.dart
diff --git a/tests/compiler/dart2js/resolver_test.dart b/tests/compiler/dart2js/resolver_test.dart
index 8587e3e03c471553a5736426f2100abd7d848923..0a1a9dd41bf06e39267fd30dc1848a3bb56d49b7 100644
--- a/tests/compiler/dart2js/resolver_test.dart
+++ b/tests/compiler/dart2js/resolver_test.dart
@@ -3,6 +3,8 @@
// BSD-style license that can be found in the LICENSE file.
import "package:expect/expect.dart";
+import 'dart:async';
+import "package:async_helper/async_helper.dart";
import 'dart:collection';
import "../../../sdk/lib/_internal/compiler/implementation/resolution/resolution.dart";
@@ -841,11 +843,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) {
@@ -858,9 +861,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'));
+ asyncTest(() => compileScript(script).then((compiler) {
+ checkMemberResolved(compiler, 'C', buildSourceString('toString'));
+ }));
}
operatorName(op, isUnary) {
@@ -874,10 +877,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));
+ asyncTest(() => compileScript(script).then((compiler) {
+ checkMemberResolved(compiler, 'C', operatorName('[]', false));
+ checkMemberResolved(compiler, 'C', operatorName('[]=', false));
+ }));
}
testIncrementsAndDecrements() {
@@ -896,12 +899,12 @@ 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));
+ asyncTest(() => compileScript(script).then((compiler) {
+ checkMemberResolved(compiler, 'A', operatorName('+', false));
+ checkMemberResolved(compiler, 'B', operatorName('+', false));
+ checkMemberResolved(compiler, 'C', operatorName('-', false));
+ checkMemberResolved(compiler, 'D', operatorName('-', false));
+ }));
}
testOverrideHashCodeCheck() {
@@ -916,9 +919,10 @@ testOverrideHashCodeCheck() {
main() {
new A() == new B();
}""";
- final compiler = compileScript(script);
- Expect.equals(1, compiler.warnings.length);
- Expect.equals(MessageKind.OVERRIDE_EQUALS_NOT_HASH_CODE,
- compiler.warnings[0].message.kind);
- Expect.equals(0, compiler.errors.length);
+ asyncTest(() => compileScript(script).then((compiler) {
+ Expect.equals(1, compiler.warnings.length);
+ Expect.equals(MessageKind.OVERRIDE_EQUALS_NOT_HASH_CODE,
+ compiler.warnings[0].message.kind);
+ Expect.equals(0, compiler.errors.length);
+ }));
}
« no previous file with comments | « tests/compiler/dart2js/resolution_test.dart ('k') | tests/compiler/dart2js/rewrite_better_user_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698