[flutter_tools] reland remove flutter view cache (#56387)

Fixes #56194

Remove caching of FlutterView and poll forever if the list of flutter views is empty. Added test for missing release mode logic.
This commit is contained in:
Jonah Williams
2020-05-05 12:09:51 -07:00
committed by GitHub
parent f84d16a5fe
commit 9b7b9d795e
18 changed files with 367 additions and 282 deletions

View File

@@ -239,7 +239,6 @@ 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) {
@@ -250,13 +249,13 @@ class FakeVmServiceHost {
if (fakeRequest.errorCode == null) {
_input.add(json.encode(<String, Object>{
'jsonrpc': '2.0',
'id': fakeRequest.id,
'id': request['id'],
'result': fakeRequest.jsonResponse ?? <String, Object>{'type': 'Success'},
}));
} else {
_input.add(json.encode(<String, Object>{
'jsonrpc': '2.0',
'id': fakeRequest.id,
'id': request['id'],
'error': <String, Object>{
'code': fakeRequest.errorCode,
}
@@ -299,7 +298,6 @@ abstract class VmServiceExpectation {
class FakeVmServiceRequest implements VmServiceExpectation {
const FakeVmServiceRequest({
@required this.method,
@required this.id,
this.args = const <String, Object>{},
this.jsonResponse,
this.errorCode,
@@ -307,7 +305,6 @@ class FakeVmServiceRequest implements VmServiceExpectation {
});
final String method;
final String id;
/// When true, the vm service is automatically closed.
final bool close;