Unverified Commit 511367aa authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tools] remove k toggle for canvaskit from web runner (#66273)

The k toggle allows switching between canvaskit and html backend at runtime. unfortunately this causes hot restart to break, since the dart_sdk modules stores state at runtime. The recommendation will be to use cavaskit via dart-defines.
parent 4c7f7463
......@@ -799,9 +799,6 @@ class _ResidentWebRunner extends ResidentWebRunner {
return 0;
}
@override
bool get supportsCanvasKit => supportsServiceProtocol;
@override
Future<bool> toggleCanvaskit() async {
final WebDevFS webDevFS = device.devFS as WebDevFS;
......
......@@ -795,7 +795,6 @@ abstract class ResidentRunner {
bool get isRunningProfile => debuggingOptions.buildInfo.isProfile;
bool get isRunningRelease => debuggingOptions.buildInfo.isRelease;
bool get supportsServiceProtocol => isRunningDebug || isRunningProfile;
bool get supportsCanvasKit => false;
bool get supportsWriteSkSL => supportsServiceProtocol;
bool get trackWidgetCreation => debuggingOptions.buildInfo.trackWidgetCreation;
......@@ -1319,9 +1318,6 @@ abstract class ResidentRunner {
commandHelp.S.print();
commandHelp.U.print();
}
if (supportsCanvasKit){
commandHelp.k.print();
}
if (supportsWriteSkSL) {
commandHelp.M.print();
}
......@@ -1476,13 +1472,6 @@ class TerminalHandler {
return true;
}
return false;
case 'k':
if (residentRunner.supportsCanvasKit) {
final bool result = await residentRunner.toggleCanvaskit();
globals.printStatus('${result ? 'Enabled' : 'Disabled'} CanvasKit');
return true;
}
return false;
case 'L':
if (residentRunner.supportsServiceProtocol) {
await residentRunner.debugDumpLayerTree();
......
......@@ -1223,8 +1223,6 @@ void main() {
expect(residentRunner.supportsServiceProtocol, true);
// isRunningDebug
expect(residentRunner.isRunningDebug, true);
// does not support CanvasKit
expect(residentRunner.supportsCanvasKit, false);
// does support SkSL
expect(residentRunner.supportsWriteSkSL, true);
// commands
......@@ -1278,8 +1276,6 @@ void main() {
expect(residentRunner.supportsServiceProtocol, false);
// isRunningDebug
expect(residentRunner.isRunningDebug, false);
// does not support CanvasKit
expect(residentRunner.supportsCanvasKit, false);
// does support SkSL
expect(residentRunner.supportsWriteSkSL, false);
// commands
......
......@@ -759,7 +759,6 @@ void main() {
final WebAssetServer webAssetServer = WebAssetServer(null, null, null, null, null, null);
when(mockWebDevFS.webAssetServer).thenReturn(webAssetServer);
expect(residentWebRunner.supportsCanvasKit, true);
expect(webAssetServer.canvasKitRendering, false);
final bool toggleResult = await residentWebRunner.toggleCanvaskit();
......
......@@ -109,18 +109,6 @@ void main() {
verify(mockResidentRunner.printHelp(details: true)).called(3);
});
testUsingContext('k - toggles CanvasKit rendering and prints results', () async {
when(mockResidentRunner.supportsCanvasKit).thenReturn(true);
when(mockResidentRunner.toggleCanvaskit())
.thenAnswer((Invocation invocation) async {
return true;
});
await terminalHandler.processTerminalInput('k');
verify(mockResidentRunner.toggleCanvaskit()).called(1);
});
testUsingContext('i - debugToggleWidgetInspector with service protocol', () async {
await terminalHandler.processTerminalInput('i');
......
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