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

Unified Diff: tests/compiler/dart2js/deferred_not_in_main_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
Index: tests/compiler/dart2js/deferred_not_in_main_test.dart
diff --git a/tests/compiler/dart2js/deferred_not_in_main_test.dart b/tests/compiler/dart2js/deferred_not_in_main_test.dart
index a4b8435fa599ea785c483952d48e5bab1207e60b..0b8ef3afd343b57b3c615696ae090cbf903b1f2a 100644
--- a/tests/compiler/dart2js/deferred_not_in_main_test.dart
+++ b/tests/compiler/dart2js/deferred_not_in_main_test.dart
@@ -6,41 +6,19 @@
// to determine which elements can be deferred and which libraries
// much be included in the initial download (loaded eagerly).
+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 "dart:async";
-
-import 'package:compiler/src/dart2jslib.dart'
- as dart2js;
-
-class FakeOutputStream<T> extends EventSink<T> {
- void add(T event) {}
- void addError(T event, [StackTrace stackTrace]) {}
- void close() {}
-}
+import 'memory_compiler.dart';
void main() {
- Uri script = currentDirectory.resolveUri(Platform.script);
- Uri libraryRoot = script.resolve('../../../sdk/');
- Uri packageRoot = script.resolve('./packages/');
-
- var provider = new MemorySourceFileProvider(MEMORY_SOURCE_FILES);
- var handler = new FormattingDiagnosticHandler(provider);
-
- Compiler compiler = new Compiler(provider.readStringFromUri,
- (name, extension) => new FakeOutputStream(),
- handler.diagnosticHandler,
- libraryRoot,
- packageRoot,
- [],
- {});
+ Compiler compiler = compilerFor(MEMORY_SOURCE_FILES);
asyncTest(() => compiler.run(Uri.parse('memory:main.dart')).then((_) {
lookupLibrary(name) {
return compiler.libraryLoader.lookupLibrary(Uri.parse(name));
}
- var main = compiler.mainApp.find(dart2js.Compiler.MAIN);
+ var main = compiler.mainApp.find(Compiler.MAIN);
var outputUnitForElement = compiler.deferredLoadTask.outputUnitForElement;
var mainOutputUnit = compiler.deferredLoadTask.mainOutputUnit;
« no previous file with comments | « tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart ('k') | tests/compiler/dart2js/diagnose_ambiguous_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698