From 8d9e0d4b95808b097a4c953c560c3c6f9a414219 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Wed, 7 Oct 2020 18:07:10 -0700 Subject: [PATCH] Respect --enable-software-rendering flag on iOS simulators (#67576) --- .../flutter_tools/lib/src/ios/simulators.dart | 1 + .../general.shard/ios/simulators_test.dart | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/packages/flutter_tools/lib/src/ios/simulators.dart b/packages/flutter_tools/lib/src/ios/simulators.dart index c51a776de7..6c1ebe3b74 100644 --- a/packages/flutter_tools/lib/src/ios/simulators.dart +++ b/packages/flutter_tools/lib/src/ios/simulators.dart @@ -423,6 +423,7 @@ class IOSSimulator extends Device { '--enable-checked-mode', '--verify-entry-points', ], + if (debuggingOptions.enableSoftwareRendering) '--enable-software-rendering', if (debuggingOptions.startPaused) '--start-paused', if (debuggingOptions.disableServiceAuthCodes) '--disable-service-auth-codes', if (debuggingOptions.skiaDeterministicRendering) '--skia-deterministic-rendering', diff --git a/packages/flutter_tools/test/general.shard/ios/simulators_test.dart b/packages/flutter_tools/test/general.shard/ios/simulators_test.dart index ffbf421615..b0cdcca407 100644 --- a/packages/flutter_tools/test/general.shard/ios/simulators_test.dart +++ b/packages/flutter_tools/test/general.shard/ios/simulators_test.dart @@ -910,6 +910,29 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text''' FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), }); + + testUsingContext('startApp respects the enable software rendering flag', () async { + final IOSSimulator device = IOSSimulator( + 'x', + name: 'iPhone SE', + simulatorCategory: 'iOS 11.2', + simControl: simControl, + xcode: mockXcode, + ); + + final Directory mockDir = globals.fs.currentDirectory; + final IOSApp package = PrebuiltIOSApp(projectBundleId: 'incorrect', bundleName: 'name', bundleDir: mockDir); + + const BuildInfo mockInfo = BuildInfo(BuildMode.debug, 'flavor', treeShakeIcons: false); + final DebuggingOptions mockOptions = DebuggingOptions.enabled(mockInfo, enableSoftwareRendering: true); + await device.startApp(package, prebuiltApplication: true, debuggingOptions: mockOptions); + + verify(simControl.launch(any, any, captureAny)).captured.contains('--enable-software-rendering'); + }, overrides: { + PlistParser: () => MockPlistUtils(), + FileSystem: () => fileSystem, + ProcessManager: () => FakeProcessManager.any(), + }); }); group('IOSDevice.isSupportedForProject', () {