Dont close debug connection on exit (#42655)

This commit is contained in:
Jonah Williams
2019-10-14 17:29:04 -07:00
committed by GitHub
parent 0dce0c6e30
commit f8a5baf359
2 changed files with 4 additions and 2 deletions

View File

@@ -108,7 +108,6 @@ class ResidentWebRunner extends ResidentRunner {
if (_exited) {
return;
}
await _connectionResult?.debugConnection?.close();
await _stdOutSub?.cancel();
await _webFs?.stop();
await device.stopApp(null);

View File

@@ -431,11 +431,12 @@ void main() {
test('cleanup of resources is safe to call multiple times', () => testbed.run(() async {
_setupMocks();
bool debugClosed = false;
when(mockDebugConnection.close()).thenAnswer((Invocation invocation) async {
when(mockWebDevice.stopApp(any)).thenAnswer((Invocation invocation) async {
if (debugClosed) {
throw StateError('debug connection closed twice');
}
debugClosed = true;
return true;
});
final Completer<DebugConnectionInfo> connectionInfoCompleter = Completer<DebugConnectionInfo>();
unawaited(residentWebRunner.run(
@@ -445,6 +446,8 @@ void main() {
await residentWebRunner.exit();
await residentWebRunner.exit();
verifyNever(mockDebugConnection.close());
}));
test('Prints target and device name on run', () => testbed.run(() async {