[flutter_tools] guard L service extension in debug mode (#79173)
This commit is contained in:
@@ -1009,7 +1009,7 @@ abstract class ResidentRunner {
|
||||
}
|
||||
|
||||
Future<bool> debugDumpLayerTree() async {
|
||||
if (!supportsServiceProtocol) {
|
||||
if (!supportsServiceProtocol || !isRunningDebug) {
|
||||
return false;
|
||||
}
|
||||
for (final FlutterDevice device in flutterDevices) {
|
||||
|
||||
@@ -1976,6 +1976,22 @@ void main() {
|
||||
verifyNever(mockFlutterDevice.debugDumpLayerTree());
|
||||
}));
|
||||
|
||||
testUsingContext('ResidentRunner debugDumpLayerTree does not call flutter device if not running in debug mode', () => testbed.run(() async {
|
||||
fakeVmServiceHost = FakeVmServiceHost(requests: <VmServiceExpectation>[]);
|
||||
residentRunner = HotRunner(
|
||||
<FlutterDevice>[
|
||||
mockFlutterDevice,
|
||||
],
|
||||
stayResident: false,
|
||||
debuggingOptions: DebuggingOptions.enabled(BuildInfo.profile),
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
);
|
||||
|
||||
expect(await residentRunner.debugDumpLayerTree(), false);
|
||||
verifyNever(mockFlutterDevice.debugDumpLayerTree());
|
||||
}));
|
||||
|
||||
testUsingContext('ResidentRunner debugDumpSemanticsTreeInTraversalOrder calls flutter device', () => testbed.run(() async {
|
||||
fakeVmServiceHost = FakeVmServiceHost(requests: <VmServiceExpectation>[]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user