[flutter_tools] Use base DAP detach and ensure correct output (#119076)
This commit is contained in:
parent
22bbdf03e0
commit
8387c2388b
@ -354,7 +354,7 @@ class FlutterDebugAdapter extends FlutterBaseDebugAdapter {
|
|||||||
@override
|
@override
|
||||||
Future<void> terminateImpl() async {
|
Future<void> terminateImpl() async {
|
||||||
if (isAttach) {
|
if (isAttach) {
|
||||||
await preventBreakingAndResume();
|
await handleDetach();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send a request to stop/detach to give Flutter chance to do some cleanup.
|
// Send a request to stop/detach to give Flutter chance to do some cleanup.
|
||||||
|
@ -122,7 +122,7 @@ abstract class FlutterBaseDebugAdapter extends DartDebugAdapter<FlutterLaunchReq
|
|||||||
@override
|
@override
|
||||||
Future<void> disconnectImpl() async {
|
Future<void> disconnectImpl() async {
|
||||||
if (isAttach) {
|
if (isAttach) {
|
||||||
await preventBreakingAndResume();
|
await handleDetach();
|
||||||
}
|
}
|
||||||
terminatePids(ProcessSignal.sigkill);
|
terminatePids(ProcessSignal.sigkill);
|
||||||
}
|
}
|
||||||
|
@ -561,11 +561,18 @@ void main() {
|
|||||||
dap.client.setBreakpoint(breakpointFilePath, breakpointLine),
|
dap.client.setBreakpoint(breakpointFilePath, breakpointLine),
|
||||||
], eagerError: true);
|
], eagerError: true);
|
||||||
|
|
||||||
// Detach.
|
// Detach and expected resume and correct output.
|
||||||
await dap.client.terminate();
|
await Future.wait(<Future<void>>[
|
||||||
|
// We should print "Detached" instead of "Exited".
|
||||||
|
dap.client.outputEvents.firstWhere((OutputEventBody event) => event.output.contains('\nDetached')),
|
||||||
|
// We should still get terminatedEvent (this signals the DAP server terminating).
|
||||||
|
dap.client.event('terminated'),
|
||||||
|
// We should get output showing the app resumed.
|
||||||
|
testProcess.output.firstWhere((String output) => output.contains('topLevelFunction')),
|
||||||
|
// Trigger the detach.
|
||||||
|
dap.client.terminate(),
|
||||||
|
]);
|
||||||
|
|
||||||
// Ensure we get additional output (confirming the process resumed).
|
|
||||||
await testProcess.output.first;
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user