[flutter_tools] reland migrate FlutterViews to package:vm_service (#55797)
Move FlutterView and related RPCs to the package:vm_service implementation. Update some getIsolate calls with catchError to match previous behavior. - Updates tests that were previously mocking FlutterViews to use real views - Moves the FlutterView cache from VM to FlutterDevice - Catch SentinelException during Isolate.kill
This commit is contained in:
@@ -242,6 +242,11 @@ class FakeVmServiceHost {
|
||||
.having((Map<String, Object> request) => request['id'], 'id', fakeRequest.id)
|
||||
.having((Map<String, Object> request) => request['params'], 'args', fakeRequest.args)
|
||||
);
|
||||
if (fakeRequest.close) {
|
||||
_vmService.dispose();
|
||||
expect(_requests, isEmpty);
|
||||
return;
|
||||
}
|
||||
if (fakeRequest.errorCode == null) {
|
||||
_input.add(json.encode(<String, Object>{
|
||||
'jsonrpc': '2.0',
|
||||
@@ -298,11 +303,15 @@ class FakeVmServiceRequest implements VmServiceExpectation {
|
||||
@required this.args,
|
||||
this.jsonResponse,
|
||||
this.errorCode,
|
||||
this.close = false,
|
||||
});
|
||||
|
||||
final String method;
|
||||
final String id;
|
||||
|
||||
/// When true, the vm service is automatically closed.
|
||||
final bool close;
|
||||
|
||||
/// If non-null, the error code for a [vm_service.RPCError] in place of a
|
||||
/// standard response.
|
||||
final int errorCode;
|
||||
|
||||
Reference in New Issue
Block a user