Unverified Commit b2a4ebe3 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

Handle single unsupported device (#39541)

parent 6266d5f3
......@@ -190,6 +190,12 @@ class DeviceManager {
if (isDeviceSupportedForProject(device, flutterProject))
device
];
} else if (devices.length == 1 &&
!hasSpecifiedDeviceId &&
!isDeviceSupportedForProject(devices.single, flutterProject)) {
// If there is only a single device but it is not supported, then return
// early.
return <Device>[];
}
// If there are still multiple devices and the user did not specify to run
......
......@@ -87,6 +87,17 @@ void main() {
]);
});
testUsingContext('Removes a single unsupported device', () async {
final List<Device> devices = <Device>[
unsupported,
];
final DeviceManager deviceManager = TestDeviceManager(devices);
final List<Device> filtered = await deviceManager.findTargetDevices(FlutterProject.current());
expect(filtered, <Device>[]);
});
testUsingContext('Removes web and fuchsia from --all', () async {
final List<Device> devices = <Device>[
webDevice,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment