HH-708: align container fonts with fingerprint maps #4
+6
-6
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user