Fix some issues with launching E2E benchmarks and add page delays in textfield benchmarks (#107500)
This commit is contained in:
@@ -11,6 +11,7 @@ class TextPage extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Material(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: const <Widget>[
|
||||
SizedBox(
|
||||
width: 200,
|
||||
|
||||
@@ -12,11 +12,7 @@ void main() {
|
||||
macroPerfTestE2E(
|
||||
'textfield_perf',
|
||||
kTextRouteName,
|
||||
// The driver version doesn't have this delay because the delay caused
|
||||
// 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),
|
||||
pageDelay: const Duration(seconds: 1),
|
||||
body: (WidgetController controller) async {
|
||||
final Finder textfield = find.byKey(const ValueKey<String>('basic-textfield'));
|
||||
controller.tap(textfield);
|
||||
|
||||
@@ -25,9 +25,16 @@ void macroPerfTestE2E(
|
||||
ControlCallback? body,
|
||||
ControlCallback? setup,
|
||||
}) {
|
||||
macroPerfTestMultiPageE2E(testName, <ScrollableButtonRoute>[
|
||||
ScrollableButtonRoute(kScrollableName, routeName),
|
||||
]);
|
||||
macroPerfTestMultiPageE2E(
|
||||
testName,
|
||||
<ScrollableButtonRoute>[
|
||||
ScrollableButtonRoute(kScrollableName, routeName),
|
||||
],
|
||||
pageDelay: pageDelay,
|
||||
duration: duration,
|
||||
body: body,
|
||||
setup: setup,
|
||||
);
|
||||
}
|
||||
|
||||
void macroPerfTestMultiPageE2E(
|
||||
|
||||
@@ -11,6 +11,7 @@ void main() {
|
||||
macroPerfTest(
|
||||
'textfield_perf',
|
||||
kTextRouteName,
|
||||
pageDelay: const Duration(seconds: 1),
|
||||
driverOps: (FlutterDriver driver) async {
|
||||
final SerializableFinder textfield = find.byValueKey('basic-textfield');
|
||||
driver.tap(textfield);
|
||||
|
||||
@@ -52,10 +52,10 @@ void macroPerfTest(
|
||||
}
|
||||
|
||||
timeline = await driver.traceAction(() async {
|
||||
final Future<void> durationFuture = Future<void>.delayed(duration);
|
||||
if (driverOps != null) {
|
||||
await driverOps(driver);
|
||||
}
|
||||
final Future<void> durationFuture = Future<void>.delayed(duration);
|
||||
if (driverOps != null) {
|
||||
await driverOps(driver);
|
||||
}
|
||||
await durationFuture;
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user