@@ -30,7 +30,7 @@ void main() {
30
30
const windowSize = Size (2000.0 , 1000.0 );
31
31
32
32
group ('ProfilerScreen' , () {
33
- void verifyBaseState () {
33
+ void verifyBaseState (WidgetTester tester ) {
34
34
expect (find.byType (StartStopRecordingButton ), findsOneWidget);
35
35
expect (find.byType (ClearButton ), findsOneWidget);
36
36
expect (find.text ('Load all CPU samples' ), findsOneWidget);
@@ -39,7 +39,37 @@ void main() {
39
39
.serviceManager
40
40
.connectedApp!
41
41
.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\n flag when "
50
+ 'starting the app, and then to use the "Load all CPU\n samples" '
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
+ );
43
73
}
44
74
expect (find.byType (CpuSamplingRateDropdown ), findsOneWidget);
45
75
expect (find.byType (OpenSaveButtonGroup ), findsOneWidget);
@@ -74,7 +104,7 @@ void main() {
74
104
windowSize,
75
105
(WidgetTester tester) async {
76
106
await pumpProfilerScreen (tester);
77
- verifyBaseState ();
107
+ verifyBaseState (tester );
78
108
},
79
109
);
80
110
@@ -89,7 +119,7 @@ void main() {
89
119
isWebApp: false ,
90
120
);
91
121
await pumpProfilerScreen (tester);
92
- verifyBaseState ();
122
+ verifyBaseState (tester );
93
123
},
94
124
);
95
125
@@ -98,7 +128,7 @@ void main() {
98
128
windowSize,
99
129
(WidgetTester tester) async {
100
130
await pumpProfilerScreen (tester);
101
- verifyBaseState ();
131
+ verifyBaseState (tester );
102
132
103
133
// Start recording.
104
134
await tester.tap (find.byType (StartStopRecordingButton ));
@@ -118,7 +148,7 @@ void main() {
118
148
// Clear the profile.
119
149
await tester.tap (find.byType (ClearButton ));
120
150
await tester.pump ();
121
- verifyBaseState ();
151
+ verifyBaseState (tester );
122
152
},
123
153
);
124
154
@@ -147,7 +177,7 @@ void main() {
147
177
await tester.pump (const Duration (seconds: 1 ));
148
178
});
149
179
await tester.pumpAndSettle ();
150
- verifyBaseState ();
180
+ verifyBaseState (tester );
151
181
});
152
182
});
153
183
}
0 commit comments