[flutter_tool] allow disabling profile mode timeline traces (#97622)

This commit is contained in:
Jonah Williams
2022-02-02 16:00:16 -08:00
committed by GitHub
parent 4a7e30f87d
commit 0b72d5ca58
2 changed files with 19 additions and 4 deletions

View File

@@ -89,16 +89,27 @@ void main() {
]);
});
testWithoutContext('buildModeOptions removes matching profile define', () {
testWithoutContext('buildModeOptions removes matching profile define in debug mode', () {
expect(buildModeOptions(BuildMode.debug, <String>['dart.vm.profile=true']), <String>[
'-Ddart.vm.product=false',
'--enable-asserts',
]);
});
testWithoutContext('buildModeOptions removes both matching profile and release define', () {
testWithoutContext('buildModeOptions removes both matching profile and release define in debug mode', () {
expect(buildModeOptions(BuildMode.debug, <String>['dart.vm.profile=true', 'dart.vm.product=true']), <String>[
'--enable-asserts',
]);
});
testWithoutContext('buildModeOptions removes matching profile define in profile mode', () {
expect(buildModeOptions(BuildMode.profile, <String>['dart.vm.profile=true']), <String>[
'-Ddart.vm.product=false',
]);
});
testWithoutContext('buildModeOptions removes both matching profile and release define in profile mode', () {
expect(buildModeOptions(BuildMode.profile, <String>['dart.vm.profile=false', 'dart.vm.product=true']), <String>[
]);
});
}