Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit e3f8786

Browse files
committed
Added plist flag for enabling trace-systrace.
1 parent c0d8f84 commit e3f8786

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,12 @@
167167
settings.enable_impeller = enableImpeller.boolValue;
168168
}
169169

170+
NSNumber* enableTraceSystrace = [mainBundle objectForInfoDictionaryKey:@"FLTTraceSystrace"];
171+
// Change the default only if the option is present.
172+
if (enableTraceSystrace != nil) {
173+
settings.trace_systrace = enableTraceSystrace.boolValue;
174+
}
175+
170176
// Leak Dart VM settings, set whether leave or clean up the VM after the last shell shuts down.
171177
NSNumber* leakDartVM = [mainBundle objectForInfoDictionaryKey:@"FLTLeakDartVM"];
172178
// It will change the default leak_vm value in settings only if the key exists.

shell/platform/darwin/ios/framework/Source/FlutterDartProjectTest.mm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ - (void)testEnableImpellerSettingIsCorrectlyParsed {
7171
XCTAssertEqual(settings.enable_impeller, NO);
7272
}
7373

74+
- (void)testEnableTraceSystraceSettingIsCorrectlyParsed {
75+
NSBundle* mainBundle = [NSBundle mainBundle];
76+
NSNumber* enableTraceSystrace = [mainBundle objectForInfoDictionaryKey:@"FLTTraceSystrace"];
77+
XCTAssertEqual(enableTraceSystrace.boolValue, NO);
78+
auto settings = FLTDefaultSettingsForBundle();
79+
XCTAssertEqual(settings.trace_systrace, NO);
80+
}
81+
7482
- (void)testEmptySettingsAreCorrect {
7583
XCTAssertFalse([FlutterDartProject allowsArbitraryLoads:[[NSDictionary alloc] init]]);
7684
XCTAssertEqualObjects(@"", [FlutterDartProject domainNetworkPolicy:[[NSDictionary alloc] init]]);

0 commit comments

Comments
 (0)