Skip to content

Commit 4d0fd4f

Browse files
authored
Fix some issues with launching E2E benchmarks and add page delays in textfield benchmarks (#107500)
1 parent bf10497 commit 4d0fd4f

File tree

5 files changed

+17
-12
lines changed

5 files changed

+17
-12
lines changed

dev/benchmarks/macrobenchmarks/lib/src/text.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class TextPage extends StatelessWidget {
1111
Widget build(BuildContext context) {
1212
return Material(
1313
child: Column(
14+
mainAxisAlignment: MainAxisAlignment.center,
1415
children: const <Widget>[
1516
SizedBox(
1617
width: 200,

dev/benchmarks/macrobenchmarks/test/textfield_perf_e2e.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ void main() {
1212
macroPerfTestE2E(
1313
'textfield_perf',
1414
kTextRouteName,
15-
// The driver version doesn't have this delay because the delay caused
16-
// by the communication between the host and the test device is long enough
17-
// for the driver test, but there isn't such delay in this host independent
18-
// test.
19-
pageDelay: const Duration(milliseconds: 50),
15+
pageDelay: const Duration(seconds: 1),
2016
body: (WidgetController controller) async {
2117
final Finder textfield = find.byKey(const ValueKey<String>('basic-textfield'));
2218
controller.tap(textfield);

dev/benchmarks/macrobenchmarks/test/util.dart

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,16 @@ void macroPerfTestE2E(
2525
ControlCallback? body,
2626
ControlCallback? setup,
2727
}) {
28-
macroPerfTestMultiPageE2E(testName, <ScrollableButtonRoute>[
29-
ScrollableButtonRoute(kScrollableName, routeName),
30-
]);
28+
macroPerfTestMultiPageE2E(
29+
testName,
30+
<ScrollableButtonRoute>[
31+
ScrollableButtonRoute(kScrollableName, routeName),
32+
],
33+
pageDelay: pageDelay,
34+
duration: duration,
35+
body: body,
36+
setup: setup,
37+
);
3138
}
3239

3340
void macroPerfTestMultiPageE2E(

dev/benchmarks/macrobenchmarks/test_driver/textfield_perf_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ void main() {
1111
macroPerfTest(
1212
'textfield_perf',
1313
kTextRouteName,
14+
pageDelay: const Duration(seconds: 1),
1415
driverOps: (FlutterDriver driver) async {
1516
final SerializableFinder textfield = find.byValueKey('basic-textfield');
1617
driver.tap(textfield);

dev/benchmarks/macrobenchmarks/test_driver/util.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ void macroPerfTest(
5252
}
5353

5454
timeline = await driver.traceAction(() async {
55-
final Future<void> durationFuture = Future<void>.delayed(duration);
56-
if (driverOps != null) {
57-
await driverOps(driver);
58-
}
55+
final Future<void> durationFuture = Future<void>.delayed(duration);
56+
if (driverOps != null) {
57+
await driverOps(driver);
58+
}
5959
await durationFuture;
6060
});
6161
});

0 commit comments

Comments
 (0)