From 11025e4acd50a30965f5e698e7aa8a384e930b6f Mon Sep 17 00:00:00 2001 From: gaaclarke <30870216+gaaclarke@users.noreply.github.com> Date: Fri, 4 Aug 2023 16:41:24 -0700 Subject: [PATCH] Sped up the time to find macrobenchmarks. (#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. --- dev/benchmarks/macrobenchmarks/test_driver/util.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dev/benchmarks/macrobenchmarks/test_driver/util.dart b/dev/benchmarks/macrobenchmarks/test_driver/util.dart index bf74fbf8ec..87b8fd2507 100644 --- a/dev/benchmarks/macrobenchmarks/test_driver/util.dart +++ b/dev/benchmarks/macrobenchmarks/test_driver/util.dart @@ -23,7 +23,11 @@ Future runDriverTestForRoute(String routeName, DriverTestCallBack body) as expect(scrollable, isNotNull); final SerializableFinder button = find.byValueKey(routeName); expect(button, isNotNull); - await driver.scrollUntilVisible(scrollable, button, dyScroll: -100.0); + // -320 comes from the logical pixels for a full screen scroll for the + // smallest reference device, iPhone 4, whose physical screen dimensions are + // 960px × 640px. + const double dyScroll = -320.0; + await driver.scrollUntilVisible(scrollable, button, dyScroll: dyScroll); await driver.tap(button); await body(driver);