Index: tests/compiler/dart2js/mirror_tree_shaking_test.dart |
diff --git a/tests/compiler/dart2js/mirror_tree_shaking_test.dart b/tests/compiler/dart2js/mirror_tree_shaking_test.dart |
index 91a397d5dc1a94b1d1f7a83e5df3de1afc038d6a..4548a70912cea1f9b8d9ae1a4607961468a2a23b 100644 |
--- a/tests/compiler/dart2js/mirror_tree_shaking_test.dart |
+++ b/tests/compiler/dart2js/mirror_tree_shaking_test.dart |
@@ -4,51 +4,24 @@ |
// Test that tree-shaking hasn't been turned off. |
-import 'package:expect/expect.dart'; |
-import "package:async_helper/async_helper.dart"; |
-import 'memory_source_file_helper.dart'; |
- |
-import 'package:compiler/src/dart2jslib.dart' |
- show NullSink; |
- |
-import 'package:compiler/compiler.dart' |
- show Diagnostic; |
- |
-import 'dart:async'; |
+import 'package:async_helper/async_helper.dart'; |
+import 'package:compiler/src/dart2jslib.dart'; |
import 'package:compiler/src/js_backend/js_backend.dart' |
show JavaScriptBackend; |
+import 'package:expect/expect.dart'; |
+import 'memory_compiler.dart'; |
main() { |
- Uri script = currentDirectory.resolveUri(Platform.script); |
- Uri libraryRoot = script.resolve('../../../sdk/'); |
- Uri packageRoot = script.resolve('./packages/'); |
- |
- var provider = new MemorySourceFileProvider(MEMORY_SOURCE_FILES); |
- void diagnosticHandler(Uri uri, int begin, int end, |
- String message, Diagnostic kind) { |
- if (kind == Diagnostic.VERBOSE_INFO |
- || kind == Diagnostic.WARNING |
- || kind == Diagnostic.HINT) { |
- return; |
- } |
- throw '$uri:$begin:$end:$message:$kind'; |
- } |
- |
- EventSink<String> outputProvider(String name, String extension) { |
- return new NullSink('$name.$extension'); |
- } |
- |
- Compiler compiler = new Compiler(provider.readStringFromUri, |
- outputProvider, |
- diagnosticHandler, |
- libraryRoot, |
- packageRoot, |
- [], |
- {}); |
+ DiagnosticCollector collector = new DiagnosticCollector(); |
+ Compiler compiler = compilerFor( |
+ MEMORY_SOURCE_FILES, diagnosticHandler: collector); |
asyncTest(() => compiler.run(Uri.parse('memory:main.dart')).then((_) { |
+ Expect.isTrue(collector.errors.isEmpty); |
+ Expect.isTrue(collector.infos.isEmpty); |
Expect.isFalse(compiler.compilationFailed); |
Expect.isFalse(compiler.enqueuer.resolution.hasEnqueuedReflectiveElements); |
- Expect.isFalse(compiler.enqueuer.resolution.hasEnqueuedReflectiveStaticFields); |
+ Expect.isFalse( |
+ compiler.enqueuer.resolution.hasEnqueuedReflectiveStaticFields); |
Expect.isFalse(compiler.enqueuer.codegen.hasEnqueuedReflectiveElements); |
Expect.isFalse(compiler.enqueuer.codegen.hasEnqueuedReflectiveStaticFields); |
Expect.isFalse(compiler.disableTypeInference); |