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

Unified Diff: pkg/front_end/lib/src/testing/compiler_common.dart

Issue 2986303003: Switch FE to use the libraries.json format. (Closed)
Patch Set: fix issues found on bots Created 3 years, 4 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
« no previous file with comments | « pkg/front_end/lib/src/fasta/uri_translator_impl.dart ('k') | pkg/front_end/messages.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/testing/compiler_common.dart
diff --git a/pkg/front_end/lib/src/testing/compiler_common.dart b/pkg/front_end/lib/src/testing/compiler_common.dart
index 02890026496c70c6b20c21e5a9360440d69e2aaa..675bbbf8ecdca7a24016cdc701dd6ef52f948ba5 100644
--- a/pkg/front_end/lib/src/testing/compiler_common.dart
+++ b/pkg/front_end/lib/src/testing/compiler_common.dart
@@ -85,6 +85,9 @@ Future<Null> setup(CompilerOptions options, Map<String, dynamic> sources,
}
});
fs.entityForUri(toTestUri('.packages')).writeAsStringSync('');
+ fs
+ .entityForUri(invalidCoreLibsSpecUri)
+ .writeAsStringSync(_invalidLibrariesSpec);
options
..verify = true
..fileSystem = new HybridFileSystem(fs)
@@ -105,13 +108,22 @@ Uri _defaultDir = Uri.parse('file:///a/b/c/');
/// helpers above.
Uri toTestUri(String relativePath) => _defaultDir.resolve(relativePath);
-/// A map defining the location of core libraries that purposely provides
-/// invalid Uris. Used by tests that want to ensure that the sdk libraries are
-/// not loaded from sources, but read from a .dill file.
-Map<String, Uri> invalidCoreLibs = {
- 'core': Uri.parse('file:///non_existing_file/core.dart'),
- 'async': Uri.parse('file:///non_existing_file/async.dart'),
-};
+/// Uri to a libraries specification file that purposely provides
+/// invalid Uris to dart:core and dart:async. Used by tests that want to ensure
+/// that the sdk libraries are not loaded from sources, but read from a .dill
+/// file.
+Uri invalidCoreLibsSpecUri = toTestUri('invalid_sdk_libraries.json');
+
+String _invalidLibrariesSpec = '''
+{
+ "vm": {
+ "libraries": {
+ "core": {"uri": "/non_existing_file/core.dart"},
+ "async": {"uri": "/non_existing_file/async.dart"}
+ }
+ }
+}
+''';
bool isDartCoreLibrary(Library lib) => isDartCore(lib.importUri);
bool isDartCore(Uri uri) => uri.scheme == 'dart' && uri.path == 'core';
« no previous file with comments | « pkg/front_end/lib/src/fasta/uri_translator_impl.dart ('k') | pkg/front_end/messages.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698