Added plist flag for enabling trace-systrace. (flutter/engine#33889)

This commit is contained in:
gaaclarke
2022-06-08 09:08:06 -07:00
committed by GitHub
parent 25f1738d22
commit 3800433d1d
3 changed files with 17 additions and 0 deletions

View File

@@ -167,6 +167,12 @@ flutter::Settings FLTDefaultSettingsForBundle(NSBundle* bundle) {
settings.enable_impeller = enableImpeller.boolValue;
}
NSNumber* enableTraceSystrace = [mainBundle objectForInfoDictionaryKey:@"FLTTraceSystrace"];
// Change the default only if the option is present.
if (enableTraceSystrace != nil) {
settings.trace_systrace = enableTraceSystrace.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

@@ -71,6 +71,15 @@ FLUTTER_ASSERT_ARC
XCTAssertEqual(settings.enable_impeller, NO);
}
- (void)testEnableTraceSystraceSettingIsCorrectlyParsed {
NSBundle* mainBundle = [NSBundle mainBundle];
NSNumber* enableTraceSystrace = [mainBundle objectForInfoDictionaryKey:@"FLTTraceSystrace"];
XCTAssertNotNil(enableTraceSystrace);
XCTAssertEqual(enableTraceSystrace.boolValue, NO);
auto settings = FLTDefaultSettingsForBundle();
XCTAssertEqual(settings.trace_systrace, NO);
}
- (void)testEmptySettingsAreCorrect {
XCTAssertFalse([FlutterDartProject allowsArbitraryLoads:[[NSDictionary alloc] init]]);
XCTAssertEqualObjects(@"", [FlutterDartProject domainNetworkPolicy:[[NSDictionary alloc] init]]);

View File

@@ -48,6 +48,8 @@
<false/>
<key>FLTEnableImpeller</key>
<false/>
<key>FLTTraceSystrace</key>
<false/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>