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

Unified Diff: pkg/front_end/test/src/incremental/mock_sdk.dart

Issue 2993113003: Revert "Switch FE to use the libraries.json format." (Closed)
Patch Set: 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
Index: pkg/front_end/test/src/incremental/mock_sdk.dart
diff --git a/pkg/front_end/test/src/incremental/mock_sdk.dart b/pkg/front_end/test/src/incremental/mock_sdk.dart
index b4b8d81c295c10f08567c484bdf0d8201718b4c3..b005e2606c37c7b1676149e5e7c9c04d014257c7 100644
--- a/pkg/front_end/test/src/incremental/mock_sdk.dart
+++ b/pkg/front_end/test/src/incremental/mock_sdk.dart
@@ -3,21 +3,18 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:front_end/memory_file_system.dart';
-import 'package:front_end/src/base/libraries_specification.dart';
/// Create SDK libraries which are used by Fasta to perform kernel generation.
-/// The root of the SDK is `file:///sdk`, it will contain a libraries
-/// specification file at `lib/libraries.json`.
-///
-/// Returns the [TargetLibrariesSpecification] whose contents are in
-/// libraries.json.
-TargetLibrariesSpecification createSdkFiles(MemoryFileSystem fileSystem) {
- Map<String, LibraryInfo> dartLibraries = {};
+/// Return the mapping from the simple names of these library to the URIs
+/// in the given [fileSystem]. The root of the SDK is `file:///sdk`.
+Map<String, Uri> createSdkFiles(MemoryFileSystem fileSystem) {
+ Map<String, Uri> dartLibraries = {};
+
void addSdkLibrary(String name, String contents) {
String path = '$name/$name.dart';
Uri uri = Uri.parse('file:///sdk/lib/$path');
fileSystem.entityForUri(uri).writeAsStringSync(contents);
- dartLibraries[name] = new LibraryInfo(name, uri, const []);
+ dartLibraries[name] = uri;
}
addSdkLibrary('core', r'''
@@ -268,10 +265,5 @@ class ExternalName {
''');
addSdkLibrary('_vmservice', 'library dart._vmservice;');
- var targetSpec = new TargetLibrariesSpecification('vm', dartLibraries);
- var spec = new LibrariesSpecification({'vm': targetSpec});
-
- Uri uri = Uri.parse('file:///sdk/lib/libraries.json');
- fileSystem.entityForUri(uri).writeAsStringSync(spec.toJsonString(uri));
- return targetSpec;
+ return dartLibraries;
}
« no previous file with comments | « pkg/front_end/test/src/incremental/kernel_driver_test.dart ('k') | pkg/front_end/test/subpackage_relationships_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698