Try golden-testing on a Mokey (bringup: true), retry on an emulator (#163029)

Towards https://github.com/flutter/flutter/issues/162362 (see if retries
help VD on an emulator).
Towards https://github.com/flutter/flutter/issues/163025 (see if we can
golden-test on a device).

May the odds be in our favor.
This commit is contained in:
Matan Lurey
2025-02-10 17:46:24 -08:00
committed by GitHub
parent af3c91045b
commit 7afc8557a4
8 changed files with 115 additions and 19 deletions

View File

@@ -77,6 +77,12 @@ final class AndroidNativeDriver implements NativeDriver {
return result['version']! as int;
}
@override
Future<bool> get isEmulator async {
final Map<String, Object?> result = await _driver.sendCommand(NativeCommand.getIsEmulator);
return result['emulator']! as bool;
}
/// Waits for 2 seconds before completing.
///
/// There is no perfect way, outside of polling, to know when the device is

View File

@@ -30,6 +30,9 @@ final class NativeCommand extends Command {
/// Gets the SDK version code.
static const NativeCommand getSdkVersion = NativeCommand('sdk_version');
/// Gets whether the device is an emulator.
static const NativeCommand getIsEmulator = NativeCommand('is_emulator');
/// The method to call on the plugin.
final String method;

View File

@@ -45,9 +45,12 @@ abstract interface class NativeDriver {
/// ```
Future<Duration> ping();
/// Returns the SDK version.
/// The SDK version.
Future<int> get sdkVersion;
/// Whether the device is an emulator.
Future<bool> get isEmulator;
/// Take a screenshot using a platform-specific mechanism.
///
/// The image is returned as an opaque handle that can be used to retrieve