[Impeller] delete Impeller sim opt out. (flutter/engine#56706)
Impeller only on simulators.
This commit is contained in:
parent
d6095e5be3
commit
8aabbdf368
@ -226,10 +226,10 @@ struct Settings {
|
|||||||
#if FML_OS_ANDROID || FML_OS_IOS || FML_OS_IOS_SIMULATOR
|
#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
|
// On iOS devices, Impeller is the default with no opt-out and this field is
|
||||||
// const.
|
// const.
|
||||||
#if FML_OS_IOS && !FML_OS_IOS_SIMULATOR
|
#if FML_OS_IOS || FML_OS_IOS_SIMULATOR
|
||||||
static constexpr const
|
static constexpr const
|
||||||
#endif // FML_OS_IOS && !FML_OS_IOS_SIMULATOR
|
#endif // FML_OS_IOS && !FML_OS_IOS_SIMULATOR
|
||||||
bool enable_impeller = true;
|
bool enable_impeller = true; // NOLINT(readability-identifier-naming)
|
||||||
#else
|
#else
|
||||||
bool enable_impeller = false;
|
bool enable_impeller = false;
|
||||||
#endif
|
#endif
|
||||||
|
@ -443,7 +443,7 @@ Settings SettingsFromCommandLine(const fml::CommandLine& command_line) {
|
|||||||
settings.use_asset_fonts =
|
settings.use_asset_fonts =
|
||||||
!command_line.HasOption(FlagForSwitch(Switch::DisableAssetFonts));
|
!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
|
// On these configurations, the Impeller flags are completely ignored with the
|
||||||
// default taking hold.
|
// default taking hold.
|
||||||
#else // FML_OS_IOS && !FML_OS_IOS_SIMULATOR
|
#else // FML_OS_IOS && !FML_OS_IOS_SIMULATOR
|
||||||
|
@ -177,21 +177,6 @@ flutter::Settings FLTDefaultSettingsForBundle(NSBundle* bundle, NSProcessInfo* p
|
|||||||
settings.enable_wide_gamut = enableWideGamut;
|
settings.enable_wide_gamut = enableWideGamut;
|
||||||
#endif
|
#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;
|
settings.warn_on_impeller_opt_out = true;
|
||||||
|
|
||||||
NSNumber* enableTraceSystrace = [mainBundle objectForInfoDictionaryKey:@"FLTTraceSystrace"];
|
NSNumber* enableTraceSystrace = [mainBundle objectForInfoDictionaryKey:@"FLTTraceSystrace"];
|
||||||
|
@ -225,16 +225,6 @@ FLUTTER_ASSERT_ARC
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (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 {
|
- (void)testRequestsWarningWhenImpellerOptOut {
|
||||||
auto settings = FLTDefaultSettingsForBundle();
|
auto settings = FLTDefaultSettingsForBundle();
|
||||||
XCTAssertEqual(settings.warn_on_impeller_opt_out, YES);
|
XCTAssertEqual(settings.warn_on_impeller_opt_out, YES);
|
||||||
@ -277,49 +267,6 @@ FLUTTER_ASSERT_ARC
|
|||||||
[mockMainBundle stopMocking];
|
[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 {
|
- (void)testEnableTraceSystraceSettingIsCorrectlyParsed {
|
||||||
NSBundle* mainBundle = [NSBundle mainBundle];
|
NSBundle* mainBundle = [NSBundle mainBundle];
|
||||||
NSNumber* enableTraceSystrace = [mainBundle objectForInfoDictionaryKey:@"FLTTraceSystrace"];
|
NSNumber* enableTraceSystrace = [mainBundle objectForInfoDictionaryKey:@"FLTTraceSystrace"];
|
||||||
|
@ -64,7 +64,6 @@ void main(List<String> args) async {
|
|||||||
osRuntime: results.option('os-runtime')!,
|
osRuntime: results.option('os-runtime')!,
|
||||||
osVersion: results.option('os-version')!,
|
osVersion: results.option('os-version')!,
|
||||||
withImpeller: results.flag('with-impeller'),
|
withImpeller: results.flag('with-impeller'),
|
||||||
withSkia: results.flag('with-skia'),
|
|
||||||
dumpXcresultOnFailure: dumpXcresultOnFailurePath,
|
dumpXcresultOnFailure: dumpXcresultOnFailurePath,
|
||||||
);
|
);
|
||||||
completer.complete();
|
completer.complete();
|
||||||
@ -110,7 +109,6 @@ Future<void> _run(
|
|||||||
required String osRuntime,
|
required String osRuntime,
|
||||||
required String osVersion,
|
required String osVersion,
|
||||||
required bool withImpeller,
|
required bool withImpeller,
|
||||||
required bool withSkia,
|
|
||||||
required String? dumpXcresultOnFailure,
|
required String? dumpXcresultOnFailure,
|
||||||
}) async {
|
}) async {
|
||||||
// Terminate early on SIGINT.
|
// Terminate early on SIGINT.
|
||||||
@ -135,45 +133,6 @@ Future<void> _run(
|
|||||||
|
|
||||||
cleanup.add(() => _deleteIfPresent(resultBundle));
|
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) {
|
if (withImpeller) {
|
||||||
final process = await _runTests(
|
final process = await _runTests(
|
||||||
outScenariosPath: scenarioPath,
|
outScenariosPath: scenarioPath,
|
||||||
@ -247,15 +206,7 @@ final _args = ArgParser()
|
|||||||
)
|
)
|
||||||
..addFlag(
|
..addFlag(
|
||||||
'with-impeller',
|
'with-impeller',
|
||||||
help: 'Whether to use the Impeller backend to run the tests.\n\nCan be '
|
help: 'Whether to use the Impeller backend to run the tests.',
|
||||||
'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.',
|
|
||||||
defaultsTo: true,
|
defaultsTo: true,
|
||||||
)
|
)
|
||||||
..addOption(
|
..addOption(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user