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 acb2095fc0c39442962eed293fd83d9699eaa983..bd12211376a2e221f1820c5b83fc13ea93f45653 100644 |
--- a/pkg/analysis_server/test/mock_sdk.dart |
+++ b/pkg/analysis_server/test/mock_sdk.dart |
@@ -274,8 +274,15 @@ const Map<String, LibraryInfo> libraries = const { |
LIBRARIES.forEach((SdkLibrary library) { |
provider.newFile(library.path, (library as MockSdkLibrary).content); |
}); |
- provider.newFile('/lib/_internal/sdk_library_metadata/lib/libraries.dart', |
+ provider.newFile( |
+ provider.convertPath( |
+ '/lib/_internal/sdk_library_metadata/lib/libraries.dart'), |
librariesContent); |
+ List<int> bytes = _computeLinkedBundleBytes(); |
+ provider.newFileWithBytes( |
+ provider.convertPath('/lib/_internal/spec.sum'), bytes); |
+ provider.newFileWithBytes( |
+ provider.convertPath('/lib/_internal/strong.sum'), bytes); |
} |
@override |
@@ -341,13 +348,7 @@ const Map<String, LibraryInfo> libraries = const { |
@override |
PackageBundle getLinkedBundle() { |
if (_bundle == null) { |
- List<Source> librarySources = sdkLibraries |
- .map((SdkLibrary library) => mapDartUri(library.shortName)) |
- .toList(); |
- List<int> bytes = new SummaryBuilder( |
- librarySources, context, context.analysisOptions.strongMode) |
- .build(); |
- _bundle = new PackageBundle.fromBuffer(bytes); |
+ _bundle = new PackageBundle.fromBuffer(_computeLinkedBundleBytes()); |
scheglov
2016/12/02 01:15:52
If we already have these bytes in the file system,
Brian Wilkerson
2016/12/02 15:32:04
Probably so, but when I tried to use the stored by
|
} |
return _bundle; |
} |
@@ -383,6 +384,18 @@ const Map<String, LibraryInfo> libraries = const { |
// table above. |
return null; |
} |
+ |
+ /** |
+ * Compute the bytes in the linked bundle associated with this SDK. |
+ */ |
+ List<int> _computeLinkedBundleBytes() { |
+ List<Source> librarySources = sdkLibraries |
+ .map((SdkLibrary library) => mapDartUri(library.shortName)) |
+ .toList(); |
+ return new SummaryBuilder( |
+ librarySources, context, context.analysisOptions.strongMode) |
+ .build(); |
+ } |
} |
class MockSdkLibrary implements SdkLibrary { |