| Index: tests/compiler/dart2js/mirror_helper_test.dart
|
| diff --git a/tests/compiler/dart2js/mirror_helper_test.dart b/tests/compiler/dart2js/mirror_helper_test.dart
|
| index 01e69edba3f1c0144b7668bb51e5f655234e61b8..0919b86fd090012d8835918e19ab424c8c296b70 100644
|
| --- a/tests/compiler/dart2js/mirror_helper_test.dart
|
| +++ b/tests/compiler/dart2js/mirror_helper_test.dart
|
| @@ -29,10 +29,10 @@ show
|
|
|
|
|
| main() {
|
| - testWithMirrorRenaming();
|
| - testWithoutMirrorRenaming();
|
| - testWithMirrorRenamingMinify();
|
| - testWithoutMirrorRenamingMinify();
|
| + testWithMirrorRenaming(minify: true);
|
| + testWithMirrorRenaming(minify: false);
|
| + testWithoutMirrorRenaming(minify: true);
|
| + testWithoutMirrorRenaming(minify: false);
|
| }
|
|
|
| Compiler runCompiler({useMirrorHelperLibrary: false, minify: false}) {
|
| @@ -47,8 +47,8 @@ Compiler runCompiler({useMirrorHelperLibrary: false, minify: false}) {
|
| return compiler;
|
| }
|
|
|
| -void testWithMirrorRenaming() {
|
| - Compiler compiler = runCompiler(useMirrorHelperLibrary: true, minify: false);
|
| +void testWithMirrorRenaming({bool minify}) {
|
| + Compiler compiler = runCompiler(useMirrorHelperLibrary: true, minify: minify);
|
|
|
| DartBackend backend = compiler.backend;
|
| Map<Node, String> renames = backend.renames;
|
| @@ -58,52 +58,16 @@ void testWithMirrorRenaming() {
|
| backend.memberNodes.values.first.first.body.statements.nodes.head;
|
|
|
| Expect.equals(MirrorRenamer.MIRROR_HELPER_GET_NAME_FUNCTION,
|
| - renames[getNameFunctionNode.expression.selector]);
|
| - Expect.equals(MirrorRenamer.MIRROR_HELPER_CLASS_FULLY_QUALIFIED_NAME,
|
| + MirrorRenamer.inverseRenames[
|
| + renames[getNameFunctionNode.expression.selector]]);
|
| + Expect.equals("",
|
| renames[getNameFunctionNode.expression.receiver]);
|
| - Expect.equals(2, imports.keys.length);
|
| - Expect.isTrue(imports.keys.any((library) =>
|
| - library.canonicalUri ==
|
| - new Uri(path: MirrorRenamer.MIRROR_HELPER_LIBRARY_NAME)));
|
| -}
|
| -
|
| -void testWithMirrorRenamingMinify() {
|
| - Compiler compiler = runCompiler(useMirrorHelperLibrary: true, minify: true);
|
| -
|
| - DartBackend backend = compiler.backend;
|
| - Map<Node, String> renames = backend.renames;
|
| - Map<LibraryElement, String> imports = backend.imports;
|
| -
|
| - Node getNameFunctionNode =
|
| - backend.memberNodes.values.first.first.body.statements.nodes.head;
|
| -
|
| - Expect.equals(MirrorRenamer.MIRROR_HELPER_GET_NAME_FUNCTION,
|
| - renames[getNameFunctionNode.expression.selector]);
|
| - Expect.equals(MirrorRenamer.MIRROR_HELPER_CLASS_FULLY_QUALIFIED_NAME,
|
| - renames[getNameFunctionNode.expression.receiver]);
|
| - Expect.equals(2, imports.keys.length);
|
| - Expect.isTrue(imports.keys.any((library) =>
|
| - library.canonicalUri ==
|
| - new Uri(path: MirrorRenamer.MIRROR_HELPER_LIBRARY_NAME)));
|
| -}
|
| -
|
| -void testWithoutMirrorRenaming() {
|
| - Compiler compiler = runCompiler(useMirrorHelperLibrary: false, minify: false);
|
| -
|
| - DartBackend backend = compiler.backend;
|
| - Map<Node, String> renames = backend.renames;
|
| - Map<LibraryElement, String> imports = backend.imports;
|
| -
|
| - Node getNameFunctionNode =
|
| - backend.memberNodes.values.first.first.body.statements.nodes.head;
|
| -
|
| - Expect.isFalse(renames.containsKey(getNameFunctionNode.expression.selector));
|
| - Expect.isFalse(renames.containsKey(getNameFunctionNode.expression.receiver));
|
| Expect.equals(1, imports.keys.length);
|
| }
|
|
|
| -void testWithoutMirrorRenamingMinify() {
|
| - Compiler compiler = runCompiler(useMirrorHelperLibrary: false, minify: true);
|
| +void testWithoutMirrorRenaming({bool minify}) {
|
| + Compiler compiler =
|
| + runCompiler(useMirrorHelperLibrary: false, minify: minify);
|
|
|
| DartBackend backend = compiler.backend;
|
| Map<Node, String> renames = backend.renames;
|
|
|