mirror of
https://github.com/flutter/flutter
synced 2024-10-12 19:23:02 +00:00
[flutter_tools] bail from printing if devtools launch fails (#83934)
This commit is contained in:
parent
c6359dc93f
commit
ca789bf5a1
|
@ -82,6 +82,10 @@ class FlutterResidentDevtoolsHandler implements ResidentDevtoolsHandler {
|
|||
_served = true;
|
||||
}
|
||||
await _devToolsLauncher.ready;
|
||||
// Do not attempt to print debugger list if the connection has failed.
|
||||
if (_devToolsLauncher.activeDevToolsServer == null) {
|
||||
return;
|
||||
}
|
||||
final List<FlutterDevice> devicesWithExtension = await _devicesWithExtensions(flutterDevices);
|
||||
await _maybeCallDevToolsUriServiceExtension(devicesWithExtension);
|
||||
await _callConnectedVmServiceUriExtension(devicesWithExtension);
|
||||
|
|
|
@ -192,6 +192,22 @@ void main() {
|
|||
);
|
||||
});
|
||||
|
||||
testWithoutContext('serveAndAnnounceDevTools will bail if launching devtools fails', () async {
|
||||
final ResidentDevtoolsHandler handler = FlutterResidentDevtoolsHandler(
|
||||
FakeDevtoolsLauncher()..activeDevToolsServer = null,
|
||||
FakeResidentRunner(),
|
||||
BufferLogger.test(),
|
||||
);
|
||||
final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(requests: <VmServiceExpectation>[], httpAddress: Uri.parse('http://localhost:1234'));
|
||||
|
||||
final FakeFlutterDevice device = FakeFlutterDevice()
|
||||
..vmService = fakeVmServiceHost.vmService;
|
||||
|
||||
await handler.serveAndAnnounceDevTools(
|
||||
flutterDevices: <FlutterDevice>[device],
|
||||
);
|
||||
});
|
||||
|
||||
testWithoutContext('serveAndAnnounceDevTools with web device', () async {
|
||||
final ResidentDevtoolsHandler handler = FlutterResidentDevtoolsHandler(
|
||||
FakeDevtoolsLauncher()..activeDevToolsServer = DevToolsServerAddress('localhost', 8080),
|
||||
|
|
|
@ -1926,7 +1926,6 @@ void main() {
|
|||
FileSystem: () => ThrowingForwardingFileSystem(MemoryFileSystem.test()),
|
||||
}));
|
||||
|
||||
|
||||
testUsingContext('ColdRunner writes vm service file when providing debugging option', () => testbed.run(() async {
|
||||
fakeVmServiceHost = FakeVmServiceHost(requests: <VmServiceExpectation>[
|
||||
listViews,
|
||||
|
|
Loading…
Reference in a new issue