This reverts commit 209bdcb669.
This commit is contained in:
@@ -239,6 +239,7 @@ class FakeVmServiceHost {
|
||||
final FakeVmServiceRequest fakeRequest = _requests.removeAt(0) as FakeVmServiceRequest;
|
||||
expect(request, isA<Map<String, Object>>()
|
||||
.having((Map<String, Object> request) => request['method'], 'method', fakeRequest.method)
|
||||
.having((Map<String, Object> request) => request['id'], 'id', fakeRequest.id)
|
||||
.having((Map<String, Object> request) => request['params'], 'args', fakeRequest.args)
|
||||
);
|
||||
if (fakeRequest.close) {
|
||||
@@ -249,13 +250,13 @@ class FakeVmServiceHost {
|
||||
if (fakeRequest.errorCode == null) {
|
||||
_input.add(json.encode(<String, Object>{
|
||||
'jsonrpc': '2.0',
|
||||
'id': request['id'],
|
||||
'id': fakeRequest.id,
|
||||
'result': fakeRequest.jsonResponse ?? <String, Object>{'type': 'Success'},
|
||||
}));
|
||||
} else {
|
||||
_input.add(json.encode(<String, Object>{
|
||||
'jsonrpc': '2.0',
|
||||
'id': request['id'],
|
||||
'id': fakeRequest.id,
|
||||
'error': <String, Object>{
|
||||
'code': fakeRequest.errorCode,
|
||||
}
|
||||
@@ -298,6 +299,7 @@ abstract class VmServiceExpectation {
|
||||
class FakeVmServiceRequest implements VmServiceExpectation {
|
||||
const FakeVmServiceRequest({
|
||||
@required this.method,
|
||||
@required this.id,
|
||||
this.args = const <String, Object>{},
|
||||
this.jsonResponse,
|
||||
this.errorCode,
|
||||
@@ -305,6 +307,7 @@ class FakeVmServiceRequest implements VmServiceExpectation {
|
||||
});
|
||||
|
||||
final String method;
|
||||
final String id;
|
||||
|
||||
/// When true, the vm service is automatically closed.
|
||||
final bool close;
|
||||
|
||||
Reference in New Issue
Block a user