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

Unified Diff: tests/compiler/dart2js/analyze_all_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 | « sdk/lib/_internal/compiler/samples/leap/leap_leg.dart ('k') | tests/compiler/dart2js/analyze_api_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/analyze_all_test.dart
diff --git a/tests/compiler/dart2js/analyze_all_test.dart b/tests/compiler/dart2js/analyze_all_test.dart
index 2a7fcc701279c10b384e30e5970a6979e1589920..58a313c50b663260eb2c277593fea38337914c8b 100644
--- a/tests/compiler/dart2js/analyze_all_test.dart
+++ b/tests/compiler/dart2js/analyze_all_test.dart
@@ -3,7 +3,8 @@
// BSD-style license that can be found in the LICENSE file.
import "package:expect/expect.dart";
-import 'compiler_helper.dart';
+import "compiler_helper.dart";
+import "package:async_helper/async_helper.dart";
const String SOURCE = """
class Foo {
@@ -28,24 +29,29 @@ main() {
main() {
Uri uri = Uri.parse('test:code');
- var compiler = compilerFor(SOURCE, uri, analyzeAll: false);
- compiler.runCompiler(uri);
- Expect.isFalse(compiler.compilationFailed);
- print(compiler.warnings);
- Expect.isTrue(compiler.warnings.isEmpty, 'unexpected warnings');
- Expect.isTrue(compiler.errors.isEmpty, 'unexpected errors');
- compiler = compilerFor(SOURCE, uri, analyzeAll: true);
- compiler.runCompiler(uri);
- Expect.isTrue(compiler.compilationFailed);
- Expect.isTrue(compiler.warnings.isEmpty, 'unexpected warnings');
- Expect.equals(2, compiler.errors.length,
- 'expected exactly two errors, but got ${compiler.errors}');
-
- Expect.equals(MessageKind.CONSTRUCTOR_IS_NOT_CONST,
- compiler.errors[0].message.kind);
- Expect.equals("Foo", compiler.errors[0].node.toString());
-
- Expect.equals(MessageKind.CONSTRUCTOR_IS_NOT_CONST,
- compiler.errors[1].message.kind);
- Expect.equals("Foo", compiler.errors[1].node.toString());
+ asyncStart();
+ var compiler1 = compilerFor(SOURCE, uri, analyzeAll: false);
+ compiler1.runCompiler(uri).then((_) {
+ Expect.isFalse(compiler1.compilationFailed);
+ print(compiler1.warnings);
+ Expect.isTrue(compiler1.warnings.isEmpty, 'unexpected warnings');
+ Expect.isTrue(compiler1.errors.isEmpty, 'unexpected errors');
+ }).whenComplete(() => asyncEnd());
+
+ asyncStart();
+ var compiler2 = compilerFor(SOURCE, uri, analyzeAll: true);
+ compiler2.runCompiler(uri).then((_) {
+ Expect.isTrue(compiler2.compilationFailed);
+ Expect.isTrue(compiler2.warnings.isEmpty, 'unexpected warnings');
+ Expect.equals(2, compiler2.errors.length,
+ 'expected exactly two errors, but got ${compiler2.errors}');
+
+ Expect.equals(MessageKind.CONSTRUCTOR_IS_NOT_CONST,
+ compiler2.errors[0].message.kind);
+ Expect.equals("Foo", compiler2.errors[0].node.toString());
+
+ Expect.equals(MessageKind.CONSTRUCTOR_IS_NOT_CONST,
+ compiler2.errors[1].message.kind);
+ Expect.equals("Foo", compiler2.errors[1].node.toString());
+ }).whenComplete(() => asyncEnd());
}
« no previous file with comments | « sdk/lib/_internal/compiler/samples/leap/leap_leg.dart ('k') | tests/compiler/dart2js/analyze_api_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698