diff --git a/common/settings.h b/common/settings.h index 689a0781d5e44..617ac202adb81 100644 --- a/common/settings.h +++ b/common/settings.h @@ -226,10 +226,10 @@ struct Settings { #if FML_OS_ANDROID || FML_OS_IOS || FML_OS_IOS_SIMULATOR // On iOS devices, Impeller is the default with no opt-out and this field is // const. -#if FML_OS_IOS && !FML_OS_IOS_SIMULATOR +#if FML_OS_IOS || FML_OS_IOS_SIMULATOR static constexpr const -#endif // FML_OS_IOS && !FML_OS_IOS_SIMULATOR - bool enable_impeller = true; +#endif // FML_OS_IOS && !FML_OS_IOS_SIMULATOR + bool enable_impeller = true; // NOLINT(readability-identifier-naming) #else bool enable_impeller = false; #endif diff --git a/shell/common/switches.cc b/shell/common/switches.cc index b3bac173623e2..9aa9b1528f0d6 100644 --- a/shell/common/switches.cc +++ b/shell/common/switches.cc @@ -443,7 +443,7 @@ Settings SettingsFromCommandLine(const fml::CommandLine& command_line) { settings.use_asset_fonts = !command_line.HasOption(FlagForSwitch(Switch::DisableAssetFonts)); -#if FML_OS_IOS && !FML_OS_IOS_SIMULATOR +#if FML_OS_IOS || FML_OS_IOS_SIMULATOR // On these configurations, the Impeller flags are completely ignored with the // default taking hold. #else // FML_OS_IOS && !FML_OS_IOS_SIMULATOR diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm index 613cdfaa73973..3f31c181f3d17 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm @@ -177,21 +177,6 @@ static BOOL DoesHardwareSupportWideGamut() { settings.enable_wide_gamut = enableWideGamut; #endif -#if FML_OS_IOS_SIMULATOR - if (!command_line.HasOption("enable-impeller")) { - // Next, look in the app bundle. - NSNumber* enableImpeller = [bundle objectForInfoDictionaryKey:@"FLTEnableImpeller"]; - if (enableImpeller == nil) { - // If it isn't in the app bundle, look in the main bundle. - enableImpeller = [mainBundle objectForInfoDictionaryKey:@"FLTEnableImpeller"]; - } - // Change the default only if the option is present. - if (enableImpeller != nil) { - settings.enable_impeller = enableImpeller.boolValue; - } - } -#endif // FML_OS_IOS_SIMULATOR - settings.warn_on_impeller_opt_out = true; NSNumber* enableTraceSystrace = [mainBundle objectForInfoDictionaryKey:@"FLTTraceSystrace"]; diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartProjectTest.mm b/shell/platform/darwin/ios/framework/Source/FlutterDartProjectTest.mm index 19c7d4fc66252..fbb2cbe3c21aa 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartProjectTest.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartProjectTest.mm @@ -225,16 +225,6 @@ - (void)testLookUpForAssetsFromPackageFromBundle { } } -- (void)testDisableImpellerSettingIsCorrectlyParsed { - id mockMainBundle = OCMPartialMock([NSBundle mainBundle]); - OCMStub([mockMainBundle objectForInfoDictionaryKey:@"FLTEnableImpeller"]).andReturn(@"NO"); - - auto settings = FLTDefaultSettingsForBundle(); - // Check settings.enable_impeller value is same as the value defined in Info.plist. - XCTAssertEqual(settings.enable_impeller, NO); - [mockMainBundle stopMocking]; -} - - (void)testRequestsWarningWhenImpellerOptOut { auto settings = FLTDefaultSettingsForBundle(); XCTAssertEqual(settings.warn_on_impeller_opt_out, YES); @@ -277,49 +267,6 @@ - (void)testEnableDartAssertsCommandLineArgument { [mockMainBundle stopMocking]; } -- (void)testDisableImpellerSettingIsCorrectlyOverriddenByCommandLine { - id mockMainBundle = OCMPartialMock([NSBundle mainBundle]); - OCMStub([mockMainBundle objectForInfoDictionaryKey:@"FLTEnableImpeller"]).andReturn(@"YES"); - id mockProcessInfo = OCMPartialMock([NSProcessInfo processInfo]); - NSArray* arguments = @[ @"process_name", @"--enable-impeller=false" ]; - OCMStub([mockProcessInfo arguments]).andReturn(arguments); - - auto settings = FLTDefaultSettingsForBundle(nil, mockProcessInfo); - // Check settings.enable_impeller value is same as the value on command line. - XCTAssertEqual(settings.enable_impeller, NO); - [mockMainBundle stopMocking]; -} - -- (void)testDisableImpellerAppBundleSettingIsCorrectlyParsed { - NSString* bundleId = [FlutterDartProject defaultBundleIdentifier]; - id mockAppBundle = OCMClassMock([NSBundle class]); - OCMStub([mockAppBundle objectForInfoDictionaryKey:@"FLTEnableImpeller"]).andReturn(@"NO"); - OCMStub([mockAppBundle bundleWithIdentifier:bundleId]).andReturn(mockAppBundle); - - auto settings = FLTDefaultSettingsForBundle(); - // Check settings.enable_impeller value is same as the value defined in Info.plist. - XCTAssertEqual(settings.enable_impeller, NO); - - [mockAppBundle stopMocking]; -} - -- (void)testEnableImpellerAppBundleSettingIsCorrectlyParsed { - NSString* bundleId = [FlutterDartProject defaultBundleIdentifier]; - id mockAppBundle = OCMClassMock([NSBundle class]); - OCMStub([mockAppBundle objectForInfoDictionaryKey:@"FLTEnableImpeller"]).andReturn(@"YES"); - OCMStub([mockAppBundle bundleWithIdentifier:bundleId]).andReturn(mockAppBundle); - - // Since FLTEnableImpeller is set to false in the main bundle, this is also - // testing that setting FLTEnableImpeller in the app bundle takes - // precedence over setting it in the root bundle. - - auto settings = FLTDefaultSettingsForBundle(); - // Check settings.enable_impeller value is same as the value defined in Info.plist. - XCTAssertEqual(settings.enable_impeller, YES); - - [mockAppBundle stopMocking]; -} - - (void)testEnableTraceSystraceSettingIsCorrectlyParsed { NSBundle* mainBundle = [NSBundle mainBundle]; NSNumber* enableTraceSystrace = [mainBundle objectForInfoDictionaryKey:@"FLTTraceSystrace"]; diff --git a/testing/scenario_app/bin/run_ios_tests.dart b/testing/scenario_app/bin/run_ios_tests.dart index 2e059bd4e6f9c..eef2ab76eca6b 100644 --- a/testing/scenario_app/bin/run_ios_tests.dart +++ b/testing/scenario_app/bin/run_ios_tests.dart @@ -64,7 +64,6 @@ void main(List args) async { osRuntime: results.option('os-runtime')!, osVersion: results.option('os-version')!, withImpeller: results.flag('with-impeller'), - withSkia: results.flag('with-skia'), dumpXcresultOnFailure: dumpXcresultOnFailurePath, ); completer.complete(); @@ -110,7 +109,6 @@ Future _run( required String osRuntime, required String osVersion, required bool withImpeller, - required bool withSkia, required String? dumpXcresultOnFailure, }) async { // Terminate early on SIGINT. @@ -135,45 +133,6 @@ Future _run( cleanup.add(() => _deleteIfPresent(resultBundle)); - if (withSkia) { - io.stderr.writeln('Running simulator tests with Skia'); - io.stderr.writeln(); - final process = await _runTests( - outScenariosPath: scenarioPath, - resultBundlePath: resultBundle.path, - osVersion: osVersion, - deviceName: deviceName, - iosEngineVariant: iosEngineVariant, - xcodeBuildExtraArgs: [ - // Plist with `FTEEnableImpeller=NO`; all projects in the workspace require this file. - // For example, `FlutterAppExtensionTestHost` has a dummy file under the below directory. - r'INFOPLIST_FILE=$(TARGET_NAME)/Info_Skia.plist', - ], - ); - cleanup.add(process.kill); - - // Create a temporary directory, if needed. - var storePath = dumpXcresultOnFailure; - if (storePath == null) { - final dumpDir = io.Directory.systemTemp.createTempSync(); - storePath = dumpDir.path; - cleanup.add(() => dumpDir.delete(recursive: true)); - } - - if (await process.exitCode != 0) { - final String outputPath = _zipAndStoreFailedTestResults( - iosEngineVariant: iosEngineVariant, - resultBundle: resultBundle, - storePath: storePath, - ); - io.stderr.writeln('Failed test results are stored at $outputPath'); - throw _ToolFailure('test failed.'); - } else { - io.stderr.writeln('test succcess.'); - } - _deleteIfPresent(resultBundle); - } - if (withImpeller) { final process = await _runTests( outScenariosPath: scenarioPath, @@ -247,15 +206,7 @@ final _args = ArgParser() ) ..addFlag( 'with-impeller', - help: 'Whether to use the Impeller backend to run the tests.\n\nCan be ' - 'combined with --with-skia to run the test suite with both backends.', - defaultsTo: true, - ) - ..addFlag( - 'with-skia', - help: - 'Whether to use the Skia backend to run the tests.\n\nCan be combined ' - 'with --with-impeller to run the test suite with both backends.', + help: 'Whether to use the Impeller backend to run the tests.', defaultsTo: true, ) ..addOption(