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

Add fuchsia devices to daemon command (#25344)

parent 4c24bcc8
......@@ -19,6 +19,7 @@ import '../build_info.dart';
import '../cache.dart';
import '../device.dart';
import '../emulator.dart';
import '../fuchsia/fuchsia_device.dart';
import '../globals.dart';
import '../ios/devices.dart';
import '../ios/simulators.dart';
......@@ -567,6 +568,7 @@ class DeviceDomain extends Domain {
registerHandler('forward', forward);
registerHandler('unforward', unforward);
addDeviceDiscoverer(FuchsiaDevices());
addDeviceDiscoverer(AndroidDevices());
addDeviceDiscoverer(IOSDevices());
addDeviceDiscoverer(IOSSimulators());
......
......@@ -7,6 +7,7 @@ import 'dart:async';
import 'package:flutter_tools/src/android/android_workflow.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/commands/daemon.dart';
import 'package:flutter_tools/src/fuchsia/fuchsia_workflow.dart';
import 'package:flutter_tools/src/globals.dart';
import 'package:flutter_tools/src/ios/ios_workflow.dart';
import 'package:flutter_tools/src/resident_runner.dart';
......@@ -197,6 +198,7 @@ void main() {
}, overrides: <Type, Generator>{
AndroidWorkflow: () => MockAndroidWorkflow(canListDevices: false),
IOSWorkflow: () => MockIOSWorkflow(),
FuchsiaWorkflow: () => MockFuchsiaWorkflow(),
});
testUsingContext('device.getDevices should respond with list', () async {
......@@ -241,6 +243,7 @@ void main() {
}, overrides: <Type, Generator>{
AndroidWorkflow: () => MockAndroidWorkflow(),
IOSWorkflow: () => MockIOSWorkflow(),
FuchsiaWorkflow: () => MockFuchsiaWorkflow(),
});
testUsingContext('emulator.launch without an emulatorId should report an error', () async {
......@@ -303,6 +306,13 @@ bool _notEvent(Map<String, dynamic> map) => map['event'] == null;
bool _isConnectedEvent(Map<String, dynamic> map) => map['event'] == 'daemon.connected';
class MockFuchsiaWorkflow extends FuchsiaWorkflow {
MockFuchsiaWorkflow({ this.canListDevices = true });
@override
final bool canListDevices;
}
class MockAndroidWorkflow extends AndroidWorkflow {
MockAndroidWorkflow({ this.canListDevices = true });
......
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