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

Unified Diff: pkg/analysis_server/test/mock_sdk.dart

Issue 2286923002: Convert analysis server over to use ContextBuilder (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: address comment, fix bugs, clean-up Created 4 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/analysis_server/test/mock_sdk.dart
diff --git a/pkg/analysis_server/test/mock_sdk.dart b/pkg/analysis_server/test/mock_sdk.dart
index 5681817f2775a8d1c8a3d6c1f7de9ca367e851ba..0d39a192e724dabd6c339bf262c4e3a969fc56e0 100644
--- a/pkg/analysis_server/test/mock_sdk.dart
+++ b/pkg/analysis_server/test/mock_sdk.dart
@@ -242,18 +242,32 @@ external void printToConsole(String line);
LIB_INTERNAL,
];
- final resource.MemoryResourceProvider provider =
- new resource.MemoryResourceProvider();
+ static const String librariesContent = r'''
+const Map<String, LibraryInfo> libraries = const {
+ "async": const LibraryInfo("async/async.dart"),
+ "collection": const LibraryInfo("collection/collection.dart"),
+ "convert": const LibraryInfo("convert/convert.dart"),
+ "core": const LibraryInfo("core/core.dart"),
+ "html": const LibraryInfo("html/dartium/html_dartium.dart"),
+ "math": const LibraryInfo("math/math.dart"),
+ "_internal": const LibraryInfo("internal/internal.dart"),
+};
+''';
+
+ final resource.MemoryResourceProvider provider;
/**
* The [AnalysisContext] which is used for all of the sources.
*/
InternalAnalysisContext _analysisContext;
- MockSdk() {
+ MockSdk({resource.ResourceProvider resourceProvider})
+ : provider = resourceProvider ?? new resource.MemoryResourceProvider() {
LIBRARIES.forEach((SdkLibrary library) {
provider.newFile(library.path, (library as MockSdkLibrary).content);
});
+ provider.newFile('/lib/_internal/sdk_library_metadata/lib/libraries.dart',
+ librariesContent);
}
@override
« no previous file with comments | « pkg/analysis_server/test/integration/integration_tests.dart ('k') | pkg/analysis_server/test/search/type_hierarchy_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698