Added flag to disable the dart profiler on iOS (flutter/engine#33907)
This commit is contained in:
@@ -173,6 +173,12 @@ flutter::Settings FLTDefaultSettingsForBundle(NSBundle* bundle) {
|
||||
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.
|
||||
|
||||
@@ -80,6 +80,15 @@ FLUTTER_ASSERT_ARC
|
||||
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]]);
|
||||
|
||||
@@ -50,6 +50,8 @@
|
||||
<false/>
|
||||
<key>FLTTraceSystrace</key>
|
||||
<false/>
|
||||
<key>FLTEnableDartProfiling</key>
|
||||
<false/>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
|
||||
Reference in New Issue
Block a user