| Index: tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
|
| diff --git a/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart b/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
|
| index a3624f075a6349797d9831df6ea024f49315ac72..59b39e3f59da0db4d35b9748d3d62a217cc886e0 100644
|
| --- a/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
|
| +++ b/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
|
| @@ -6,43 +6,20 @@
|
| // to determine which elements can be deferred and which libraries
|
| // much be included in the initial download (loaded eagerly).
|
|
|
| -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;
|
| -
|
| +import 'package:async_helper/async_helper.dart';
|
| +import 'package:compiler/src/dart2jslib.dart';
|
| import 'package:compiler/src/deferred_load.dart';
|
| -
|
| -class FakeOutputStream<T> extends EventSink<T> {
|
| - void add(T event) {}
|
| - void addError(T event, [StackTrace stackTrace]) {}
|
| - void close() {}
|
| -}
|
| +import 'package:expect/expect.dart';
|
| +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);
|
| Expect.isNotNull(main, "Could not find 'main'");
|
| compiler.deferredLoadTask.onResolutionComplete(main);
|
|
|
|
|