From ca78e0147ca4bd840eb64551c9cdb3319363ebab Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Tue, 19 Nov 2024 08:16:30 -0800 Subject: [PATCH 1/8] [Impeller] delete Impeller sim opt out. --- common/settings.h | 2 +- .../ios/framework/Source/FlutterDartProject.mm | 15 --------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/common/settings.h b/common/settings.h index 689a0781d5e44..b2a68a4bebded 100644 --- a/common/settings.h +++ b/common/settings.h @@ -226,7 +226,7 @@ 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; 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"]; From 764e3f401b84fd97348f33808bbce1e64ccfc778 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Tue, 19 Nov 2024 08:23:57 -0800 Subject: [PATCH 2/8] Update settings.h --- common/settings.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/settings.h b/common/settings.h index b2a68a4bebded..a80a7f68cba5f 100644 --- a/common/settings.h +++ b/common/settings.h @@ -226,7 +226,7 @@ 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; From 15b12f99bba5cfd131d92f343063d95f398d4dbc Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Tue, 19 Nov 2024 12:34:17 -0800 Subject: [PATCH 3/8] actually fix. --- shell/common/switches.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From aef4ca4154afbc0c7eadfdc7bc03a42994758a06 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Tue, 19 Nov 2024 14:11:29 -0800 Subject: [PATCH 4/8] update test. --- shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm | 2 -- 1 file changed, 2 deletions(-) diff --git a/shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm b/shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm index 58bfbdf1605dc..bb31e04866f2f 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm @@ -445,7 +445,6 @@ - (void)testEnableSemanticsWhenFlutterViewAccessibilityDidCall { - (void)testCanMergePlatformAndUIThread { #if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR auto settings = FLTDefaultSettingsForBundle(); - settings.enable_impeller = true; FlutterDartProject* project = [[FlutterDartProject alloc] initWithSettings:settings]; FlutterEngine* engine = [[FlutterEngine alloc] initWithName:@"foobar" project:project]; [engine run]; @@ -458,7 +457,6 @@ - (void)testCanMergePlatformAndUIThread { - (void)testCanUnMergePlatformAndUIThread { #if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR auto settings = FLTDefaultSettingsForBundle(); - settings.enable_impeller = true; settings.merged_platform_ui_thread = false; FlutterDartProject* project = [[FlutterDartProject alloc] initWithSettings:settings]; FlutterEngine* engine = [[FlutterEngine alloc] initWithName:@"foobar" project:project]; From 3f51b656d40c64b9dedf0cea0ae4a2bac31c63a5 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Tue, 19 Nov 2024 23:38:13 -0800 Subject: [PATCH 5/8] ++ --- common/settings.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/settings.h b/common/settings.h index a80a7f68cba5f..617ac202adb81 100644 --- a/common/settings.h +++ b/common/settings.h @@ -228,8 +228,8 @@ struct Settings { // const. #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 From bc95e1846ed355bae3516cc46c4c6e815cedb4d9 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Wed, 20 Nov 2024 09:57:48 -0800 Subject: [PATCH 6/8] delete --with-skia. --- testing/scenario_app/bin/run_ios_tests.dart | 51 +-------------------- 1 file changed, 1 insertion(+), 50 deletions(-) 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( From 8ff45d9e43ec4a7625580c5f4edf8282313e1d24 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Fri, 22 Nov 2024 08:56:00 -0800 Subject: [PATCH 7/8] delete tests. --- .../Source/FlutterDartProjectTest.mm | 43 ------------------- 1 file changed, 43 deletions(-) diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartProjectTest.mm b/shell/platform/darwin/ios/framework/Source/FlutterDartProjectTest.mm index 19c7d4fc66252..9425f6d1e437a 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartProjectTest.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartProjectTest.mm @@ -277,49 +277,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"]; From 48e7b116ef1a2b1a8b0f36f3fbfa69c0b4285209 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Fri, 22 Nov 2024 11:26:32 -0800 Subject: [PATCH 8/8] Update FlutterDartProjectTest.mm --- .../ios/framework/Source/FlutterDartProjectTest.mm | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartProjectTest.mm b/shell/platform/darwin/ios/framework/Source/FlutterDartProjectTest.mm index 9425f6d1e437a..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);