@@ -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'
49+ "\n app's startup is to set the `--focus-on-profiling-startup` "
50+ 'CLI\n flag when starting the app, and then to use the "Load all '
51+ 'CPU\n samples" 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