LibWeb: Run LibWeb layout tests using headless-browser

This commit is contained in:
Timothy Flynn 2023-03-13 07:32:44 -04:00 committed by Linus Groh
parent 7090f74524
commit 127d2e2098

View file

@ -10,16 +10,12 @@ if [[ -z "${LADYBIRD_BUILD_DIR}" ]] ; then
exit 1
fi
if [[ "$(uname -s)" = "Darwin" ]] ; then
LADYBIRD_BINARY="./ladybird.app/Contents/MacOS/ladybird"
else
LADYBIRD_BINARY="./ladybird"
fi
BROWSER_BINARY="./headless-browser"
for input_html_path in "${SCRIPT_DIR}"/input/*.html; do
input_html_file="$(basename "${input_html_path}" .html)"
output_layout_dump=$(cd "${LADYBIRD_BUILD_DIR}"; "${LADYBIRD_BINARY}" -d "${input_html_path}")
output_layout_dump=$(cd "${LADYBIRD_BUILD_DIR}"; "${BROWSER_BINARY}" -d "${input_html_path}")
expected_layout_dump_path="${SCRIPT_DIR}/expected/${input_html_file}.txt"
if cmp <(echo "${output_layout_dump}") "${expected_layout_dump_path}"; then