Benchmark: compile with the baseline profile only, find off-screen rows

The app is now compiled the way Macrobenchmark's Partial mode does it,
so runs compare baseline profiles instead of what the JIT learned in a
warm-up run. Tapping a row scrolls the list when the row is off screen.
This commit is contained in:
2026-10-25 12:35:23 +02:00
parent 603e90dcca
commit 9e744b309e
2 changed files with 23 additions and 9 deletions
+5 -2
View File
@@ -23,7 +23,8 @@ tap_text() {
import re, sys
xml, text = sys.stdin.read(), sys.argv[1]
for node in re.findall(r"<node [^>]*>", xml):
if re.search(r"(text|content-desc)=\"%s\"" % re.escape(text), node):
# Compose merges a clickable row into one node: "System, 3 of 5"
if re.search(r"(text|content-desc)=\"%s(\"|, )" % re.escape(text), node):
x1, y1, x2, y2 = map(int, re.search(r"bounds=\"\[(\d+),(\d+)\]\[(\d+),(\d+)\]\"", node).groups())
print((x1 + x2) // 2, (y1 + y2) // 2)
break
@@ -32,6 +33,8 @@ for node in re.findall(r"<node [^>]*>", xml):
adb shell input tap $xy
return 0
fi
# Lazy lists only show what is on screen; with "scroll", look further down
[[ "${2:-}" == scroll ]] && adb shell input swipe $((W / 2)) $((H * 2 / 3)) $((W / 2)) $((H / 3)) 300
sleep 1
done
echo "::warning::'$1' not found on screen"
@@ -51,7 +54,7 @@ for _ in 1 2 3; do
swipe
tap_text "Monitor"; sleep 2
tap_text "Apps"; sleep 3
tap_text "System"; sleep 2
tap_text "System" scroll; sleep 2
swipe
tap_text "Blocklist"; sleep 2
swipe