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

Unified Diff: tests/compiler/dart2js/mirror_helper_rename_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/memory_compiler.dart ('k') | tests/compiler/dart2js/mock_compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/mirror_helper_rename_test.dart
diff --git a/tests/compiler/dart2js/mirror_helper_rename_test.dart b/tests/compiler/dart2js/mirror_helper_rename_test.dart
index 35495513fccc2b60bd935c3ec48453caddbb94bf..2428dfef7843976eca3becef7d0acc42263c083f 100644
--- a/tests/compiler/dart2js/mirror_helper_rename_test.dart
+++ b/tests/compiler/dart2js/mirror_helper_rename_test.dart
@@ -5,7 +5,7 @@
import "package:expect/expect.dart";
import 'dart:async';
import "package:async_helper/async_helper.dart";
-import 'memory_compiler.dart' show compilerFor;
+import 'memory_compiler.dart' show compilerFor, OutputCollector;
import 'package:compiler/src/apiimpl.dart' show
Compiler;
import 'package:compiler/src/tree/tree.dart' show
@@ -20,12 +20,15 @@ main() {
testWithoutMirrorHelperLibrary(minify: false);
}
-Future<Compiler> runCompiler({useMirrorHelperLibrary: false, minify: false}) {
+Future<Compiler> runCompiler({OutputCollector outputCollector,
+ bool useMirrorHelperLibrary: false,
+ bool minify: false}) {
List<String> options = ['--output-type=dart'];
if (minify) {
options.add('--minify');
}
- Compiler compiler = compilerFor(MEMORY_SOURCE_FILES, options: options);
+ Compiler compiler = compilerFor(
+ MEMORY_SOURCE_FILES, outputProvider: outputCollector, options: options);
DartBackend backend = compiler.backend;
backend.useMirrorHelperLibrary = useMirrorHelperLibrary;
return
@@ -33,8 +36,12 @@ Future<Compiler> runCompiler({useMirrorHelperLibrary: false, minify: false}) {
}
void testWithMirrorHelperLibrary({bool minify}) {
- asyncTest(() => runCompiler(useMirrorHelperLibrary: true, minify: minify).
- then((Compiler compiler) {
+ OutputCollector outputCollector = new OutputCollector();
+ asyncTest(() =>
+ runCompiler(outputCollector: outputCollector,
+ useMirrorHelperLibrary: true,
+ minify: minify)
+ .then((Compiler compiler) {
DartBackend backend = compiler.backend;
MirrorRenamerImpl mirrorRenamer = backend.mirrorRenamer;
Map<Node, String> renames = backend.placeholderRenamer.renames;
@@ -55,7 +62,7 @@ void testWithMirrorHelperLibrary({bool minify}) {
}
}
- String output = compiler.assembledCode;
+ String output = outputCollector.getOutput('', 'dart');
String getNameMatch = MirrorRenamerImpl.MIRROR_HELPER_GET_NAME_FUNCTION;
Iterable i = getNameMatch.allMatches(output);
print(output);
« no previous file with comments | « tests/compiler/dart2js/memory_compiler.dart ('k') | tests/compiler/dart2js/mock_compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698