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

Unified Diff: tests/compiler/dart2js/unneeded_part_js_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/sourcemaps/sourcemap_helper.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/unneeded_part_js_test.dart
diff --git a/tests/compiler/dart2js/unneeded_part_js_test.dart b/tests/compiler/dart2js/unneeded_part_js_test.dart
index 6c52339236f8bed1786ba60ee813bc47a8ecf7cb..2ad0c3e625a31689c72b54d747e088bf1cf436c2 100644
--- a/tests/compiler/dart2js/unneeded_part_js_test.dart
+++ b/tests/compiler/dart2js/unneeded_part_js_test.dart
@@ -4,45 +4,22 @@
// Test that no parts are emitted when deferred loading isn't used.
+import 'package:async_helper/async_helper.dart';
+import 'package:compiler/src/dart2jslib.dart';
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 '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) {
- return;
- }
- throw '$uri:$begin:$end:$message:$kind';
- }
-
- EventSink<String> outputProvider(String name, String extension) {
- if (name != '') throw 'Attempt to output file "$name.$extension"';
- return new NullSink('$name.$extension');
- }
+ DiagnosticCollector diagnostics = new DiagnosticCollector();
+ OutputCollector output = new OutputCollector();
+ Compiler compiler = compilerFor(
+ MEMORY_SOURCE_FILES,
+ diagnosticHandler: diagnostics,
+ outputProvider: output);
- Compiler compiler = new Compiler(provider.readStringFromUri,
- outputProvider,
- diagnosticHandler,
- libraryRoot,
- packageRoot,
- [],
- {});
asyncTest(() => compiler.run(Uri.parse('memory:main.dart')).then((_) {
+ Expect.isFalse(diagnostics.hasRegularMessages);
+ Expect.isFalse(output.hasExtraOutput);
Expect.isFalse(compiler.compilationFailed);
}));
}
« no previous file with comments | « tests/compiler/dart2js/sourcemaps/sourcemap_helper.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698