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

Unified Diff: tests/compiler/dart2js/mock_compiler.dart

Issue 1884793002: dart2js: remove references to compiler in ResolvedUriTranslator (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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/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>();
« pkg/compiler/lib/src/compiler.dart ('K') | « tests/compiler/dart2js/library_resolution_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698