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

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

Issue 832363002: Remove Compiler.assembledCode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix unittest 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/incremental/hello_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 9966f59feb6ebda835dd8c0899ce6c35087daf44..9b31127e2fe649310fadbe9e32313d60838a8e23 100644
--- a/tests/compiler/dart2js/exit_code_test.dart
+++ b/tests/compiler/dart2js/exit_code_test.dart
@@ -152,14 +152,15 @@ Future testExitCode(String marker, String type, int expectedExitCode) {
}
}
return new Future(() {
- 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 {}]) {
+ 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 {}]) {
libraryRoot = Platform.script.resolve('../../../sdk/');
outputProvider = NullSink.outputProvider;
// Use this to silence the test when debugging:
@@ -174,19 +175,8 @@ Future testExitCode(String marker, String type, int expectedExitCode) {
marker,
type,
onTest);
- 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;
+ return compiler.run(script).then((bool success) {
+ return new api.CompilationResult(compiler, isSuccess: success);
});
}
@@ -214,7 +204,9 @@ Future testExitCode(String marker, String type, int expectedExitCode) {
Future result = entry.internalMain(
["tests/compiler/dart2js/exit_code_helper.dart"]);
- return result.whenComplete(checkResult);
+ return result.catchError((e, s) {
+ // Capture crashes.
+ }).whenComplete(checkResult);
});
}
« no previous file with comments | « tests/compiler/dart2js/compiler_helper.dart ('k') | tests/compiler/dart2js/incremental/hello_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698