Skip to content

Commit 11025e4

Browse files
authored
Sped up the time to find macrobenchmarks. (flutter#131959)
This reduce the execution time of macrobenchmarks driver tests. I tried to find the exact size to scroll the screen but I couldn't find a way to do that with driver tests.
1 parent 53082f6 commit 11025e4

File tree

1 file changed

+5
-1
lines changed
  • dev/benchmarks/macrobenchmarks/test_driver

1 file changed

+5
-1
lines changed

dev/benchmarks/macrobenchmarks/test_driver/util.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ Future<void> runDriverTestForRoute(String routeName, DriverTestCallBack body) as
2323
expect(scrollable, isNotNull);
2424
final SerializableFinder button = find.byValueKey(routeName);
2525
expect(button, isNotNull);
26-
await driver.scrollUntilVisible(scrollable, button, dyScroll: -100.0);
26+
// -320 comes from the logical pixels for a full screen scroll for the
27+
// smallest reference device, iPhone 4, whose physical screen dimensions are
28+
// 960px × 640px.
29+
const double dyScroll = -320.0;
30+
await driver.scrollUntilVisible(scrollable, button, dyScroll: dyScroll);
2731
await driver.tap(button);
2832

2933
await body(driver);

0 commit comments

Comments
 (0)