[flutter_tools] flutter precache downloads all enabled platforms if no flags are provided (#73733)

This commit is contained in:
Jonah Williams
2021-01-11 14:29:02 -08:00
committed by GitHub
parent 7ed30cb7e5
commit f7dc19eb23
2 changed files with 43 additions and 7 deletions

View File

@@ -268,6 +268,7 @@ void main() {
const <String>[
'precache',
'--no-ios',
'--android',
'--android_gen_snapshot',
'--android_maven',
'--android_internal_build',
@@ -403,6 +404,34 @@ void main() {
verify(cache.clearStampFiles()).called(1);
});
testUsingContext('precache downloads all enabled platforms if no flags are provided.', () async {
final PrecacheCommand command = PrecacheCommand(
cache: cache,
logger: BufferLogger.test(),
featureFlags: TestFeatureFlags(
isWebEnabled: true,
isLinuxEnabled: true,
isWindowsEnabled: true,
isMacOSEnabled: true,
isIOSEnabled: false,
isAndroidEnabled: false,
),
platform: FakePlatform(environment: <String, String>{}),
);
await createTestCommandRunner(command).run(const <String>['precache']);
expect(
artifacts,
unorderedEquals(<DevelopmentArtifact>{
DevelopmentArtifact.web,
DevelopmentArtifact.macOS,
DevelopmentArtifact.windows,
DevelopmentArtifact.linux,
DevelopmentArtifact.universal,
// iOS and android specifically excluded
}));
});
}
class MockCache extends Mock implements Cache {}