[web] Fix reading of the --local-web-sdk flag and remove the copy of useLocalWebSdk in DebuggingOptions (#152642)

This commit is contained in:
Jason Simmons
2024-08-08 09:27:21 -07:00
committed by GitHub
parent 14cd5fa30a
commit d23be7a07d
8 changed files with 33 additions and 33 deletions

View File

@@ -1459,7 +1459,7 @@ class TestRunCommandForUsageValues extends RunCommand {
}
@override
Future<BuildInfo> getBuildInfo({FlutterProject? project, BuildMode? forcedBuildMode, File? forcedTargetFile}) async {
Future<BuildInfo> getBuildInfo({FlutterProject? project, BuildMode? forcedBuildMode, File? forcedTargetFile, bool? forcedUseLocalCanvasKit}) async {
return const BuildInfo(BuildMode.debug, null, treeShakeIcons: false, packageConfigPath: '.dart_tool/package_config.json');
}
}

View File

@@ -700,6 +700,18 @@ void main() {
ProcessManager: () => processManager,
});
testUsingContext('sets useLocalCanvasKit in BuildInfo', () async {
final DummyFlutterCommand flutterCommand = DummyFlutterCommand();
final CommandRunner<void> runner = createTestCommandRunner(flutterCommand);
fileSystem.directory('engine/src/out/wasm_release').createSync(recursive: true);
await runner.run(<String>['--local-web-sdk=wasm_release', '--local-engine-src-path=engine/src', 'dummy']);
final BuildInfo buildInfo = await flutterCommand.getBuildInfo(forcedBuildMode: BuildMode.debug);
expect(buildInfo.useLocalCanvasKit, isTrue);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('dds options', () async {
final FakeDdsCommand ddsCommand = FakeDdsCommand();
final CommandRunner<void> runner = createTestCommandRunner(ddsCommand);