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

Commit a3fd166

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

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-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: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,15 @@ - (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+
XCTAssertNotNil(enableTraceSystrace);
78+
XCTAssertEqual(enableTraceSystrace.boolValue, NO);
79+
auto settings = FLTDefaultSettingsForBundle();
80+
XCTAssertEqual(settings.trace_systrace, NO);
81+
}
82+
7483
- (void)testEmptySettingsAreCorrect {
7584
XCTAssertFalse([FlutterDartProject allowsArbitraryLoads:[[NSDictionary alloc] init]]);
7685
XCTAssertEqualObjects(@"", [FlutterDartProject domainNetworkPolicy:[[NSDictionary alloc] init]]);

testing/ios/IosUnitTests/App/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
<false/>
4949
<key>FLTEnableImpeller</key>
5050
<false/>
51+
<key>FLTTraceSystrace</key>
52+
<false/>
5153
<key>UIRequiredDeviceCapabilities</key>
5254
<array>
5355
<string>armv7</string>

0 commit comments

Comments
 (0)