Index: tests/compiler/dart2js/mock_compiler.dart |
diff --git a/tests/compiler/dart2js/mock_compiler.dart b/tests/compiler/dart2js/mock_compiler.dart |
index e2628b89e99556d19efb267d96b1d7dffc8dc2ba..839c0836978295477bf4ddd274caa8bc21efbdb8 100644 |
--- a/tests/compiler/dart2js/mock_compiler.dart |
+++ b/tests/compiler/dart2js/mock_compiler.dart |
@@ -27,6 +27,7 @@ import 'package:compiler/src/resolution/members.dart'; |
import 'package:compiler/src/resolution/registry.dart'; |
import 'package:compiler/src/resolution/scope.dart'; |
import 'package:compiler/src/resolution/tree_elements.dart'; |
+import 'package:compiler/src/resolved_uri_translator.dart'; |
import 'package:compiler/src/script.dart'; |
import 'package:compiler/src/tree/tree.dart'; |
import 'package:compiler/src/old_to_new_api.dart'; |
@@ -65,6 +66,8 @@ class MockCompiler extends Compiler { |
final String testedPatchVersion; |
final LibrarySourceProvider librariesOverride; |
final DiagnosticCollector diagnosticCollector = new DiagnosticCollector(); |
+ final ResolvedUriTranslator resolvedUriTranslator = |
+ new MockResolvedUriTranslator(); |
MockCompiler.internal( |
{Map<String, String> coreSource, |
@@ -257,9 +260,6 @@ class MockCompiler extends Compiler { |
return new Future.value(); |
} |
- Uri translateResolvedUri(LibraryElement importingLibrary, |
- Uri resolvedUri, Spannable spannable) => resolvedUri; |
- |
// The mock library doesn't need any patches. |
Uri resolvePatchUri(String dartLibraryName) { |
if (dartLibraryName == 'core') { |
@@ -288,6 +288,17 @@ class MockCompiler extends Compiler { |
} |
} |
+class MockResolvedUriTranslator implements ResolvedUriTranslator { |
+ static final _emptySet = new Set(); |
+ |
+ Uri translate(LibraryElement importingLibrary, Uri resolvedUri, |
+ [Spannable spannable]) => |
+ resolvedUri; |
+ Set<Uri> get disallowedLibraryUris => _emptySet; |
+ bool get mockableLibraryUsed => false; |
+ Map<String, Uri> get sdkLibraries => const <String, Uri>{}; |
+} |
+ |
class CollectingTreeElements extends TreeElementMapping { |
final Map<Node, Element> map = new LinkedHashMap<Node, Element>(); |