Skip to content

Commit 6122206

Browse files
committed
[CPU Profiler] Deprecate the "Profile app start up" button
1 parent 0ac0c92 commit 6122206

File tree

3 files changed

+45
-13
lines changed

3 files changed

+45
-13
lines changed

packages/devtools_app/lib/src/screens/profiler/panes/controls/profiler_screen_controls.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,15 @@ class _SecondaryControls extends StatelessWidget {
111111
icon: Icons.timer,
112112
label: 'Profile app start up',
113113
tooltip:
114-
'Load all Dart CPU samples that occurred before \n'
115-
'the first Flutter frame was drawn (if available)',
114+
'This button is deprecated. The new procedure for profiling an'
115+
"\napp's startup is to set the `--profile-startup` CLI\nflag "
116+
'when starting the app, and then to use the "Load all CPU\n'
117+
'samples" button that is next to this one.',
116118
tooltipPadding: const EdgeInsets.all(denseSpacing),
117119
gaScreen: gac.cpuProfiler,
118120
gaSelection: gac.CpuProfilerEvents.profileAppStartUp.name,
119121
minScreenWidthForText: _profilingControlsMinScreenWidthForText,
120-
onPressed: !profilerBusy
121-
? controller.cpuProfilerController.loadAppStartUpProfile
122-
: null,
122+
onPressed: null,
123123
),
124124
const SizedBox(width: denseSpacing),
125125
RefreshButton(

packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ TODO: Remove this section if there are not any general updates.
2929

3030
## CPU profiler updates
3131

32-
TODO: Remove this section if there are not any general updates.
32+
- Deprecated the "Profile app start up" button in favor of the new Dart/Flutter
33+
`--profile-startup` CLI flags. -
34+
[#9358](https://github.com/flutter/devtools/pull/9358)
3335

3436
## Memory updates
3537

packages/devtools_app/test/screens/cpu_profiler/profiler_screen_test.dart

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void main() {
3030
const windowSize = Size(2000.0, 1000.0);
3131

3232
group('ProfilerScreen', () {
33-
void verifyBaseState() {
33+
void verifyBaseState(WidgetTester tester) {
3434
expect(find.byType(StartStopRecordingButton), findsOneWidget);
3535
expect(find.byType(ClearButton), findsOneWidget);
3636
expect(find.text('Load all CPU samples'), findsOneWidget);
@@ -39,7 +39,37 @@ void main() {
3939
.serviceManager
4040
.connectedApp!
4141
.isFlutterNativeAppNow) {
42-
expect(find.text('Profile app start up'), findsOneWidget);
42+
final profileAppStartUpButtonTextFinder = find.text(
43+
'Profile app start up',
44+
);
45+
expect(profileAppStartUpButtonTextFinder, findsOneWidget);
46+
47+
final profileAppStartUpButtonTooltipFinder = find.byTooltip(
48+
'This button is deprecated. The new procedure for profiling an\n'
49+
"app's startup is to set the `--profile-startup` CLI\nflag when "
50+
'starting the app, and then to use the "Load all CPU\nsamples" '
51+
'button that is next to this one.',
52+
);
53+
expect(profileAppStartUpButtonTooltipFinder, findsOneWidget);
54+
55+
expect(
56+
find.descendant(
57+
of: profileAppStartUpButtonTooltipFinder,
58+
matching: profileAppStartUpButtonTextFinder,
59+
),
60+
findsOneWidget,
61+
);
62+
63+
final profileAppStartUpButtonFinder = find.ancestor(
64+
of: profileAppStartUpButtonTooltipFinder,
65+
matching: find.byType(GaDevToolsButton),
66+
);
67+
expect(
68+
(tester.element(profileAppStartUpButtonFinder).widget
69+
as GaDevToolsButton)
70+
.onPressed,
71+
null,
72+
);
4373
}
4474
expect(find.byType(CpuSamplingRateDropdown), findsOneWidget);
4575
expect(find.byType(OpenSaveButtonGroup), findsOneWidget);
@@ -74,7 +104,7 @@ void main() {
74104
windowSize,
75105
(WidgetTester tester) async {
76106
await pumpProfilerScreen(tester);
77-
verifyBaseState();
107+
verifyBaseState(tester);
78108
},
79109
);
80110

@@ -89,7 +119,7 @@ void main() {
89119
isWebApp: false,
90120
);
91121
await pumpProfilerScreen(tester);
92-
verifyBaseState();
122+
verifyBaseState(tester);
93123
},
94124
);
95125

@@ -98,7 +128,7 @@ void main() {
98128
windowSize,
99129
(WidgetTester tester) async {
100130
await pumpProfilerScreen(tester);
101-
verifyBaseState();
131+
verifyBaseState(tester);
102132

103133
// Start recording.
104134
await tester.tap(find.byType(StartStopRecordingButton));
@@ -118,7 +148,7 @@ void main() {
118148
// Clear the profile.
119149
await tester.tap(find.byType(ClearButton));
120150
await tester.pump();
121-
verifyBaseState();
151+
verifyBaseState(tester);
122152
},
123153
);
124154

@@ -147,7 +177,7 @@ void main() {
147177
await tester.pump(const Duration(seconds: 1));
148178
});
149179
await tester.pumpAndSettle();
150-
verifyBaseState();
180+
verifyBaseState(tester);
151181
});
152182
});
153183
}

0 commit comments

Comments
 (0)