Adds a plist flag for Impeller (flutter/engine#32157)

This commit is contained in:
Zachary Anderson 2022-03-21 09:35:26 -07:00 committed by GitHub
parent 05bb17d606
commit 1f2acee85b
3 changed files with 20 additions and 0 deletions

View File

@ -160,6 +160,13 @@ flutter::Settings FLTDefaultSettingsForBundle(NSBundle* bundle) {
NSNumber* enableSkParagraph = [mainBundle objectForInfoDictionaryKey:@"FLTEnableSkParagraph"];
settings.enable_skparagraph = (enableSkParagraph != nil) ? enableSkParagraph.boolValue : true;
// Whether to enable Impeller.
NSNumber* enableImpeller = [mainBundle objectForInfoDictionaryKey:@"FLTEnableImpeller"];
// Change the default only if the option is present.
if (enableImpeller != nil) {
settings.enable_impeller = enableImpeller.boolValue;
}
// Leak Dart VM settings, set whether leave or clean up the VM after the last shell shuts down.
NSNumber* leakDartVM = [mainBundle objectForInfoDictionaryKey:@"FLTLeakDartVM"];
// It will change the default leak_vm value in settings only if the key exists.

View File

@ -50,6 +50,17 @@ FLUTTER_ASSERT_ARC
XCTAssertEqual(settings.leak_vm, NO);
}
- (void)testEnableImpellerSettingIsCorrectlyParsed {
// The FLTEnableImpeller's value is defined in Info.plist
NSBundle* mainBundle = [NSBundle mainBundle];
NSNumber* enableImpeller = [mainBundle objectForInfoDictionaryKey:@"FLTEnableImpeller"];
XCTAssertEqual(enableImpeller.boolValue, NO);
auto settings = FLTDefaultSettingsForBundle();
// Check settings.enable_impeller value is same as the value defined in Info.plist.
XCTAssertEqual(settings.enable_impeller, NO);
}
- (void)testEmptySettingsAreCorrect {
XCTAssertFalse([FlutterDartProject allowsArbitraryLoads:[[NSDictionary alloc] init]]);
XCTAssertEqualObjects(@"", [FlutterDartProject domainNetworkPolicy:[[NSDictionary alloc] init]]);

View File

@ -46,6 +46,8 @@
</dict>
<key>FLTLeakDartVM</key>
<false/>
<key>FLTEnableImpeller</key>
<false/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>