| Index: dart/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
|
| diff --git a/dart/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart b/dart/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
|
| index cec769e8ebae67f74d412695c591f2f272b83770..20d6e90c6e33b1caf8948920203876115db822f2 100644
|
| --- a/dart/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
|
| +++ b/dart/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
|
| @@ -7,46 +7,18 @@
|
| // much be included in the initial download (loaded eagerly).
|
|
|
| import 'package:expect/expect.dart';
|
| -import 'dart:async' show Future;
|
| -import 'dart:uri' show Uri;
|
| -import 'dart:io';
|
| -
|
| -import '../../../sdk/lib/_internal/compiler/implementation/apiimpl.dart'
|
| - show Compiler;
|
| +import 'memory_source_file_helper.dart';
|
|
|
| import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart'
|
| as dart2js;
|
|
|
| -import '../../../sdk/lib/_internal/compiler/implementation/filenames.dart'
|
| - show getCurrentDirectory, nativeToUriPath;
|
| -
|
| -import '../../../sdk/lib/_internal/compiler/implementation/source_file.dart'
|
| - show SourceFile;
|
| -
|
| -import '../../../sdk/lib/_internal/compiler/implementation/source_file_provider.dart'
|
| - show FormattingDiagnosticHandler,
|
| - SourceFileProvider;
|
| -
|
| -class MemorySourceFileProvider extends SourceFileProvider {
|
| - Future<String> readStringFromUri(Uri resourceUri) {
|
| - if (resourceUri.scheme != 'memory') {
|
| - return super.readStringFromUri(resourceUri);
|
| - }
|
| - String source = MEMORY_SOURCE_FILES[resourceUri.path];
|
| - // TODO(ahe): Return new Future.immediateError(...) ?
|
| - if (source == null) throw 'No such file $resourceUri';
|
| - String resourceName = '$resourceUri';
|
| - this.sourceFiles[resourceName] = new SourceFile(resourceName, source);
|
| - return new Future.immediate(source);
|
| - }
|
| -}
|
| -
|
| void main() {
|
| Uri cwd = getCurrentDirectory();
|
| Uri script = cwd.resolve(nativeToUriPath(new Options().script));
|
| Uri libraryRoot = script.resolve('../../../sdk/');
|
| Uri packageRoot = script.resolve('./packages/');
|
|
|
| + MemorySourceFileProvider.MEMORY_SOURCE_FILES = MEMORY_SOURCE_FILES;
|
| var provider = new MemorySourceFileProvider();
|
| var handler = new FormattingDiagnosticHandler(provider);
|
|
|
|
|