1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:27:43 +00:00

Tests: Add LibWeb layout tests

This commit is contained in:
Aliaksandr Kalenik 2023-01-29 03:07:16 +03:00 committed by Linus Groh
parent c05fcd54bb
commit 78b503946c
4 changed files with 91 additions and 0 deletions

View file

@ -0,0 +1,6 @@
InitialContainingBlock <#document> at (0,0) content-size 0x0 children: not-inline
BlockContainer <html> at (0,0) content-size 0x16 children: not-inline
BlockContainer <(anonymous)> at (0,0) content-size 0x0 children: inline
TextNode <#text>
BlockContainer <body> at (8,8) content-size 0x0 children: inline
TextNode <#text>

View file

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<head>
<title>Blank</title>
</head>
<body>
</body>
</html>

View file

@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -eo pipefail
SCRIPT_DIR="$(dirname "${0}")"
SERENITY_ROOT="$(realpath "${SCRIPT_DIR}"/../../..)"
LADYBIRD_BUILD_DIR="${SERENITY_ROOT}/Build/ladybird"
for filename in "$SCRIPT_DIR"/input/*; do
name=$(basename "$filename" .html)
input_html_path=$(realpath "$SCRIPT_DIR")/input/"$name".html
output_layout_dump=$(cd "$LADYBIRD_BUILD_DIR"; ./ladybird -d "$input_html_path")
expected_layout_dump_path="$(realpath "$SCRIPT_DIR")/expected/$name.txt"
if cmp <(echo "$output_layout_dump") "$expected_layout_dump_path"; then
echo "$name PASSED"
else
echo "$name FAILED"
diff "$expected_layout_dump_path" <(echo "$output_layout_dump")
fi
done