HH-708: align container fonts with fingerprint maps #4

Merged
rogee merged 4 commits from agent/hh-708-font-fingerprint into main 2026-08-26 21:42:11 +08:00
Showing only changes of commit 0ce20e7517 - Show all commits
+6 -6
View File
@@ -69,12 +69,12 @@ docker run --rm --entrypoint sh "$image" -c '
probe() { probe() {
local platform="$1" threshold="$2" output count local platform="$1" threshold="$2" output count
output="$(docker run --rm \ output="$(docker run --rm -i --entrypoint sh "$image" -c '
--volume "$PWD/tests/font-probe.html:/tmp/font-probe.html:ro" \ cat >/tmp/font-probe.html
--entrypoint /opt/chromium/chrome "$image" \ exec /opt/chromium/chrome --no-sandbox --headless=new --disable-gpu --disable-dev-shm-usage \
--no-sandbox --headless=new --disable-gpu --disable-dev-shm-usage \ --fingerprint=1000 --fingerprint-platform="$1" \
--fingerprint=1000 --fingerprint-platform="$platform" \ --dump-dom "file:///tmp/font-probe.html#$1"
--dump-dom "file:///tmp/font-probe.html#$platform" 2>/dev/null)" ' sh "$platform" <tests/font-probe.html 2>/dev/null)"
count="$(sed -n 's/.*data-count="\([0-9][0-9]*\)".*/\1/p' <<<"$output")" count="$(sed -n 's/.*data-count="\([0-9][0-9]*\)".*/\1/p' <<<"$output")"
[[ "$count" =~ ^[0-9]+$ && "$count" -ge "$threshold" ]] || { [[ "$count" =~ ^[0-9]+$ && "$count" -ge "$threshold" ]] || {
printf '%s font probe: expected >= %s, got %s\n' "$platform" "$threshold" "${count:-none}" >&2 printf '%s font probe: expected >= %s, got %s\n' "$platform" "$threshold" "${count:-none}" >&2