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

Added flag to disable the dart profiler on iOS #33907

Merged
merged 1 commit into from
Jun 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@
settings.trace_systrace = enableTraceSystrace.boolValue;
}

NSNumber* enableDartProfiling = [mainBundle objectForInfoDictionaryKey:@"FLTEnableDartProfiling"];
// Change the default only if the option is present.
if (enableDartProfiling != nil) {
settings.enable_dart_profiling = enableDartProfiling.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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ - (void)testEnableTraceSystraceSettingIsCorrectlyParsed {
XCTAssertEqual(settings.trace_systrace, NO);
}

- (void)testEnableDartProflingSettingIsCorrectlyParsed {
NSBundle* mainBundle = [NSBundle mainBundle];
NSNumber* enableTraceSystrace = [mainBundle objectForInfoDictionaryKey:@"FLTEnableDartProfiling"];
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]]);
Expand Down
2 changes: 2 additions & 0 deletions testing/ios/IosUnitTests/App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
<false/>
<key>FLTTraceSystrace</key>
<false/>
<key>FLTEnableDartProfiling</key>
<false/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
Expand Down