Unverified Commit cf6d4a35 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tools] guard L service extension in debug mode (#79173)

parent e6920662
......@@ -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>[]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment