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

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

Issue 1235563003: Add interfaces for a new compiler API. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Rebased Created 5 years, 5 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/message_kind_helper.dart ('k') | tests/compiler/dart2js/mirrors_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « tests/compiler/dart2js/message_kind_helper.dart ('k') | tests/compiler/dart2js/mirrors_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698