Kill resident runner on browser disconnect. (#39066)

This commit is contained in:
Jonah Williams 2019-08-26 15:06:36 -07:00 committed by GitHub
parent a1c185f37a
commit 0f8b8c91a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -160,6 +160,7 @@ class ResidentWebRunner extends ResidentRunner {
);
if (supportsServiceProtocol) {
_debugConnection = await _webFs.runAndDebug();
unawaited(_debugConnection.onDone.whenComplete(exit));
}
} catch (err, stackTrace) {
printError(err.toString());

View File

@ -65,6 +65,9 @@ void main() {
return Future<bool>.value(false);
});
when(mockDebugConnection.vmService).thenReturn(mockVmService);
when(mockDebugConnection.onDone).thenAnswer((Invocation invocation) {
return Completer<void>().future;
});
when(mockVmService.onStdoutEvent).thenAnswer((Invocation _) {
return const Stream<Event>.empty();
});