Unverified Commit 4d0fd4f8 authored by Jim Graham's avatar Jim Graham Committed by GitHub

Fix some issues with launching E2E benchmarks and add page delays in textfield benchmarks (#107500)

parent bf104974
...@@ -11,6 +11,7 @@ class TextPage extends StatelessWidget { ...@@ -11,6 +11,7 @@ class TextPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Material( return Material(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: const <Widget>[
SizedBox( SizedBox(
width: 200, width: 200,
......
...@@ -12,11 +12,7 @@ void main() { ...@@ -12,11 +12,7 @@ void main() {
macroPerfTestE2E( macroPerfTestE2E(
'textfield_perf', 'textfield_perf',
kTextRouteName, kTextRouteName,
// The driver version doesn't have this delay because the delay caused pageDelay: const Duration(seconds: 1),
// by the communication between the host and the test device is long enough
// for the driver test, but there isn't such delay in this host independent
// test.
pageDelay: const Duration(milliseconds: 50),
body: (WidgetController controller) async { body: (WidgetController controller) async {
final Finder textfield = find.byKey(const ValueKey<String>('basic-textfield')); final Finder textfield = find.byKey(const ValueKey<String>('basic-textfield'));
controller.tap(textfield); controller.tap(textfield);
......
...@@ -25,9 +25,16 @@ void macroPerfTestE2E( ...@@ -25,9 +25,16 @@ void macroPerfTestE2E(
ControlCallback? body, ControlCallback? body,
ControlCallback? setup, ControlCallback? setup,
}) { }) {
macroPerfTestMultiPageE2E(testName, <ScrollableButtonRoute>[ macroPerfTestMultiPageE2E(
ScrollableButtonRoute(kScrollableName, routeName), testName,
]); <ScrollableButtonRoute>[
ScrollableButtonRoute(kScrollableName, routeName),
],
pageDelay: pageDelay,
duration: duration,
body: body,
setup: setup,
);
} }
void macroPerfTestMultiPageE2E( void macroPerfTestMultiPageE2E(
......
...@@ -11,6 +11,7 @@ void main() { ...@@ -11,6 +11,7 @@ void main() {
macroPerfTest( macroPerfTest(
'textfield_perf', 'textfield_perf',
kTextRouteName, kTextRouteName,
pageDelay: const Duration(seconds: 1),
driverOps: (FlutterDriver driver) async { driverOps: (FlutterDriver driver) async {
final SerializableFinder textfield = find.byValueKey('basic-textfield'); final SerializableFinder textfield = find.byValueKey('basic-textfield');
driver.tap(textfield); driver.tap(textfield);
......
...@@ -52,10 +52,10 @@ void macroPerfTest( ...@@ -52,10 +52,10 @@ void macroPerfTest(
} }
timeline = await driver.traceAction(() async { timeline = await driver.traceAction(() async {
final Future<void> durationFuture = Future<void>.delayed(duration); final Future<void> durationFuture = Future<void>.delayed(duration);
if (driverOps != null) { if (driverOps != null) {
await driverOps(driver); await driverOps(driver);
} }
await durationFuture; await durationFuture;
}); });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment