mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Place flutter_gpu in the package cache. (#149299)
Resolves https://github.com/flutter/flutter/issues/131711. Fetch https://storage.googleapis.com/flutter_infra_release/flutter/${engine_version}/flutter_gpu.zip and extract it into the package cache. Cannot function until https://github.com/flutter/engine/pull/53107 has been merged/rolled into the framework.
This commit is contained in:
parent
8c4295b116
commit
02bc11c9be
@ -231,7 +231,7 @@ class FlutterSdk extends EngineCachedArtifact {
|
||||
final Platform _platform;
|
||||
|
||||
@override
|
||||
List<String> getPackageDirs() => const <String>['sky_engine'];
|
||||
List<String> getPackageDirs() => const <String>['sky_engine', 'flutter_gpu'];
|
||||
|
||||
@override
|
||||
List<List<String>> getBinaryDirs() {
|
||||
|
||||
@ -393,6 +393,44 @@ void main() {
|
||||
expect(operatingSystemUtils.chmods, <List<String>>[<String>['/.tmp_rand0/flutter_cache_test_artifact.rand0/bin_dir', 'a+r,a+x']]);
|
||||
});
|
||||
|
||||
testWithoutContext('EngineCachedArtifact downloads package zip from expected URL', () async {
|
||||
final FakeOperatingSystemUtils operatingSystemUtils = FakeOperatingSystemUtils();
|
||||
final FileSystem fileSystem = MemoryFileSystem.test();
|
||||
final Directory artifactDir = fileSystem.systemTempDirectory.createTempSync('flutter_cache_test_artifact.');
|
||||
final Directory downloadDir = fileSystem.systemTempDirectory.createTempSync('flutter_cache_test_download.');
|
||||
final FakeSecondaryCache cache = FakeSecondaryCache()
|
||||
..artifactDirectory = artifactDir
|
||||
..downloadDir = downloadDir;
|
||||
artifactDir.childDirectory('pkg').createSync();
|
||||
|
||||
final FakeCachedArtifact artifact = FakeCachedArtifact(
|
||||
cache: cache,
|
||||
binaryDirs: <List<String>>[],
|
||||
packageDirs: <String>[
|
||||
'package_dir',
|
||||
],
|
||||
requiredArtifacts: DevelopmentArtifact.universal,
|
||||
);
|
||||
|
||||
Uri? packageUrl;
|
||||
final ArtifactUpdater artifactUpdater = FakeArtifactUpdater()
|
||||
..onDownloadZipArchive = (String message, Uri url, Directory location) {
|
||||
location.childDirectory('package_dir').createSync();
|
||||
packageUrl = url;
|
||||
};
|
||||
|
||||
await artifact.updateInner(artifactUpdater, fileSystem, operatingSystemUtils);
|
||||
expect(packageUrl, isNotNull);
|
||||
expect(packageUrl.toString(), 'https://storage.googleapis.com/flutter_infra_release/flutter/null/package_dir.zip');
|
||||
|
||||
final Directory dir = fileSystem.systemTempDirectory
|
||||
.listSync(recursive: true)
|
||||
.whereType<Directory>()
|
||||
.singleWhereOrNull((Directory directory) => directory.basename == 'pkg')!;
|
||||
expect(dir.path, artifactDir.childDirectory('pkg').path);
|
||||
expect(dir.childDirectory('package_dir').existsSync(), isTrue);
|
||||
});
|
||||
|
||||
testWithoutContext('Try to remove without a parent', () async {
|
||||
final FileSystem fileSystem = MemoryFileSystem.test();
|
||||
final Directory parent = fileSystem.directory('dir');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user