Add cold boot option to emulator launch command (#82647)

This commit is contained in:
Marian Triebe
2021-05-19 19:54:04 +02:00
committed by GitHub
parent 647712e92e
commit 2d283504e6
7 changed files with 36 additions and 10 deletions

View File

@@ -144,6 +144,22 @@ void main() {
await emulator.launch(startupDuration: Duration.zero);
});
testWithoutContext('succeeds with coldboot launch', () async {
final List<String> kEmulatorLauchColdBootCommand = <String>[
...kEmulatorLaunchCommand,
'-no-snapshot-load'
];
final AndroidEmulator emulator = AndroidEmulator(emulatorID,
processManager: FakeProcessManager.list(<FakeCommand>[
FakeCommand(command: kEmulatorLauchColdBootCommand),
]),
androidSdk: mockSdk,
logger: BufferLogger.test(),
);
await emulator.launch(startupDuration: Duration.zero, coldBoot: true);
});
testWithoutContext('prints error on failure', () async {
final BufferLogger logger = BufferLogger.test();
final AndroidEmulator emulator = AndroidEmulator(emulatorID,

View File

@@ -367,7 +367,7 @@ class FakeEmulator extends Emulator {
PlatformType get platformType => PlatformType.android;
@override
Future<void> launch() {
Future<void> launch({bool coldBoot = false}) {
throw UnimplementedError('Not implemented in Mock');
}
}