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

Unified Diff: tests/compiler/dart2js/exit_code_test.dart

Issue 824103005: Revert "Remove Compiler.assembledCode." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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/js_backend_cps_ir_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/exit_code_test.dart
diff --git a/tests/compiler/dart2js/exit_code_test.dart b/tests/compiler/dart2js/exit_code_test.dart
index 9b31127e2fe649310fadbe9e32313d60838a8e23..9966f59feb6ebda835dd8c0899ce6c35087daf44 100644
--- a/tests/compiler/dart2js/exit_code_test.dart
+++ b/tests/compiler/dart2js/exit_code_test.dart
@@ -152,15 +152,14 @@ Future testExitCode(String marker, String type, int expectedExitCode) {
}
}
return new Future(() {
- Future<api.CompilationResult> compile(
- Uri script,
- Uri libraryRoot,
- Uri packageRoot,
- api.CompilerInputProvider inputProvider,
- api.DiagnosticHandler handler,
- [List<String> options = const [],
- api.CompilerOutputProvider outputProvider,
- Map<String, dynamic> environment = const {}]) {
+ Future<String> compile(Uri script,
+ Uri libraryRoot,
+ Uri packageRoot,
+ api.CompilerInputProvider inputProvider,
+ api.DiagnosticHandler handler,
+ [List<String> options = const [],
+ api.CompilerOutputProvider outputProvider,
+ Map<String, dynamic> environment = const {}]) {
libraryRoot = Platform.script.resolve('../../../sdk/');
outputProvider = NullSink.outputProvider;
// Use this to silence the test when debugging:
@@ -175,8 +174,19 @@ Future testExitCode(String marker, String type, int expectedExitCode) {
marker,
type,
onTest);
- return compiler.run(script).then((bool success) {
- return new api.CompilationResult(compiler, isSuccess: success);
+ return compiler.run(script).then((_) {
+ String code = compiler.assembledCode;
+ if (code != null && outputProvider != null) {
+ String outputType = 'js';
+ if (options.contains('--output-type=dart')) {
+ outputType = 'dart';
+ }
+ outputProvider('', outputType)
+ ..add(code)
+ ..close();
+ code = ''; // Non-null signals success.
+ }
+ return code;
});
}
@@ -204,9 +214,7 @@ Future testExitCode(String marker, String type, int expectedExitCode) {
Future result = entry.internalMain(
["tests/compiler/dart2js/exit_code_helper.dart"]);
- return result.catchError((e, s) {
- // Capture crashes.
- }).whenComplete(checkResult);
+ return result.whenComplete(checkResult);
});
}
« no previous file with comments | « tests/compiler/dart2js/compiler_helper.dart ('k') | tests/compiler/dart2js/js_backend_cps_ir_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698