Remove outdated Fuchsia concepts (#107335)
Fuchsia will soon remove all support for Component Framework version 1 components (recognized by component manifests ending in `.cmx`). Notably, some of the `flutter` tool commands for Fuchsia devices-- notably, but not limited to, those related to CFv1--are outdated, and either do not work today or soon won't work. This PR removes the outdated components and commands, replacing some with the newer version, or simply removing the non-working features, in some cases.
This commit is contained in:
@@ -25,7 +25,8 @@ void main() {
|
||||
}
|
||||
|
||||
fuchsiaVmServiceConnectionFunction = fakeServiceFunction;
|
||||
final DartVm vm = await DartVm.connect(Uri.parse('http://this.whatever/ws'));
|
||||
final DartVm vm =
|
||||
await DartVm.connect(Uri.parse('http://this.whatever/ws'));
|
||||
expect(vm, isNot(null));
|
||||
await vm.stop();
|
||||
expect(service.disposed, true);
|
||||
@@ -79,12 +80,14 @@ void main() {
|
||||
Uri uri, {
|
||||
Duration? timeout,
|
||||
}) {
|
||||
fakeService.flutterListViews = vms.Response.parse(flutterViewCannedResponses);
|
||||
fakeService.flutterListViews =
|
||||
vms.Response.parse(flutterViewCannedResponses);
|
||||
return Future<vms.VmService>(() => fakeService);
|
||||
}
|
||||
|
||||
fuchsiaVmServiceConnectionFunction = fakeVmConnectionFunction;
|
||||
final DartVm vm = await DartVm.connect(Uri.parse('http://whatever.com/ws'));
|
||||
final DartVm vm =
|
||||
await DartVm.connect(Uri.parse('http://whatever.com/ws'));
|
||||
expect(vm, isNot(null));
|
||||
final List<FlutterView> views = await vm.getAllFlutterViews();
|
||||
expect(views.length, 3);
|
||||
@@ -135,12 +138,14 @@ void main() {
|
||||
Uri uri, {
|
||||
Duration? timeout,
|
||||
}) {
|
||||
fakeService.flutterListViews = vms.Response.parse(flutterViewCannedResponses);
|
||||
fakeService.flutterListViews =
|
||||
vms.Response.parse(flutterViewCannedResponses);
|
||||
return Future<vms.VmService>(() => fakeService);
|
||||
}
|
||||
|
||||
fuchsiaVmServiceConnectionFunction = fakeVmConnectionFunction;
|
||||
final DartVm vm = await DartVm.connect(Uri.parse('http://whatever.com/ws'));
|
||||
final DartVm vm =
|
||||
await DartVm.connect(Uri.parse('http://whatever.com/ws'));
|
||||
expect(vm, isNot(null));
|
||||
final List<FlutterView> views = await vm.getAllFlutterViews();
|
||||
expect(views.length, 3);
|
||||
@@ -156,7 +161,8 @@ void main() {
|
||||
});
|
||||
|
||||
test('invalid flutter view missing ID', () async {
|
||||
final Map<String, dynamic> flutterViewCannedResponseMissingId = <String, dynamic>{
|
||||
final Map<String, dynamic> flutterViewCannedResponseMissingId =
|
||||
<String, dynamic>{
|
||||
'views': <Map<String, dynamic>>[
|
||||
// Valid flutter view.
|
||||
<String, dynamic>{
|
||||
@@ -182,12 +188,14 @@ void main() {
|
||||
Uri uri, {
|
||||
Duration? timeout,
|
||||
}) {
|
||||
fakeService.flutterListViews = vms.Response.parse(flutterViewCannedResponseMissingId);
|
||||
fakeService.flutterListViews =
|
||||
vms.Response.parse(flutterViewCannedResponseMissingId);
|
||||
return Future<vms.VmService>(() => fakeService);
|
||||
}
|
||||
|
||||
fuchsiaVmServiceConnectionFunction = fakeVmConnectionFunction;
|
||||
final DartVm vm = await DartVm.connect(Uri.parse('http://whatever.com/ws'));
|
||||
final DartVm vm =
|
||||
await DartVm.connect(Uri.parse('http://whatever.com/ws'));
|
||||
expect(vm, isNot(null));
|
||||
Future<void> failingFunction() async {
|
||||
await vm.getAllFlutterViews();
|
||||
@@ -217,7 +225,7 @@ void main() {
|
||||
'type': '@Isolate',
|
||||
'fixedId': 'true',
|
||||
'id': 'isolates/3',
|
||||
'name': 'flutterBinary.cmx',
|
||||
'name': 'flutterBinary.cm',
|
||||
'number': '3',
|
||||
})!,
|
||||
vms.IsolateRef.parse(<String, dynamic>{
|
||||
@@ -238,16 +246,20 @@ void main() {
|
||||
}
|
||||
|
||||
fuchsiaVmServiceConnectionFunction = fakeVmConnectionFunction;
|
||||
final DartVm vm = await DartVm.connect(Uri.parse('http://whatever.com/ws'));
|
||||
final DartVm vm =
|
||||
await DartVm.connect(Uri.parse('http://whatever.com/ws'));
|
||||
expect(vm, isNot(null));
|
||||
final List<IsolateRef> matchingFlutterIsolates = await vm.getMainIsolatesByPattern('flutterBinary.cmx');
|
||||
final List<IsolateRef> matchingFlutterIsolates =
|
||||
await vm.getMainIsolatesByPattern('flutterBinary.cm');
|
||||
expect(matchingFlutterIsolates.length, 1);
|
||||
final List<IsolateRef> allIsolates = await vm.getMainIsolatesByPattern('');
|
||||
final List<IsolateRef> allIsolates =
|
||||
await vm.getMainIsolatesByPattern('');
|
||||
expect(allIsolates.length, 4);
|
||||
});
|
||||
|
||||
test('invalid flutter view missing ID', () async {
|
||||
final Map<String, dynamic> flutterViewCannedResponseMissingIsolateName = <String, dynamic>{
|
||||
final Map<String, dynamic> flutterViewCannedResponseMissingIsolateName =
|
||||
<String, dynamic>{
|
||||
'views': <Map<String, dynamic>>[
|
||||
// Missing isolate name.
|
||||
<String, dynamic>{
|
||||
@@ -267,12 +279,14 @@ void main() {
|
||||
Uri uri, {
|
||||
Duration? timeout,
|
||||
}) {
|
||||
fakeService.flutterListViews = vms.Response.parse(flutterViewCannedResponseMissingIsolateName);
|
||||
fakeService.flutterListViews =
|
||||
vms.Response.parse(flutterViewCannedResponseMissingIsolateName);
|
||||
return Future<vms.VmService>(() => fakeService);
|
||||
}
|
||||
|
||||
fuchsiaVmServiceConnectionFunction = fakeVmConnectionFunction;
|
||||
final DartVm vm = await DartVm.connect(Uri.parse('http://whatever.com/ws'));
|
||||
final DartVm vm =
|
||||
await DartVm.connect(Uri.parse('http://whatever.com/ws'));
|
||||
expect(vm, isNot(null));
|
||||
Future<void> failingFunction() async {
|
||||
await vm.getAllFlutterViews();
|
||||
@@ -298,7 +312,8 @@ class FakeVmService extends Fake implements vms.VmService {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<vms.Response> callMethod(String method, {String? isolateId, Map<String, dynamic>? args}) async {
|
||||
Future<vms.Response> callMethod(String method,
|
||||
{String? isolateId, Map<String, dynamic>? args}) async {
|
||||
if (method == '_flutter.listViews') {
|
||||
return flutterListViews!;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user