Commit Graph

26 Commits

Author SHA1 Message Date
Timothy Flynn
674075f79e Everywhere: Remove LibCore/System.h includes from header files
This reduces the number of compilation jobs when System.h changes from
about 750 to 60. (There are still a large number of linker jobs.)
2025-12-04 15:40:46 +00:00
Andreas Kling
1c45930767 LibWeb+LibWebView+LibRequests: Reduce dependency on LibIPC includes
Let's try to include the IPC encoder/decoder stuff in fewer headers
to make rebuilds more pleasant when editing these files.
2025-12-01 15:12:52 +01:00
Timothy Flynn
165afd8ad1 test-web: Do not clear the WebContent crash handler between tests
Some checks failed
Close stale PRs / stale (push) Has been cancelled
Package the js repl as a binary artifact / Linux, arm64 (push) Has been cancelled
Package the js repl as a binary artifact / macOS, arm64 (push) Has been cancelled
Package the js repl as a binary artifact / Linux, x86_64 (push) Has been cancelled
Label PRs with merge conflicts / auto-labeler (push) Has been cancelled
Nightly Lagom / Linux, arm64, Distribution, Clang (push) Has been cancelled
Nightly Lagom / macOS, arm64, Distribution, Clang (push) Has been cancelled
Nightly Lagom / Linux, arm64, Sanitizer, Clang (push) Has been cancelled
Nightly Lagom / macOS, arm64, Sanitizer, Swift (push) Has been cancelled
Nightly Lagom / Linux, x86_64, Distribution, GNU (push) Has been cancelled
Nightly Lagom / Linux, x86_64, Sanitizer, Swift (push) Has been cancelled
Nightly Lagom / Windows, x86_64, Windows_Sanitizer_CI, ClangCL (push) Has been cancelled
Nightly Lagom / Flatpak aarch64 (push) Has been cancelled
Nightly Lagom / Flatpak x86_64 (push) Has been cancelled
Clearing the callback opens a window for the WebContent process to crash
while we do not have a callback set. In practice, we see this with ASAN
crashes, where the crash occurs after we've already signaled that the
test has completed.

We now set the crash handler once during init. This required moving the
clearing of other callbacks to the test completion handler (we were
clearing these callbacks in several different ways anyways, so now we
will at least be consistent).
2025-11-22 14:09:11 +01:00
Sam Atkins
eea1d4e1d2 test-web: Report which file has missing match/mismatch metadata
This makes it easier to figure out what's causing the assertion failure.
2025-11-20 16:02:40 +01:00
Timothy Flynn
bbe254f3cb test-web: Log which WebView is running each test
When trying to repro a failed CI test, it is handy to know the order in
which test-web ran its tests. We've seen in the past that the exact
order can be important to debug flakey tests.

This adds the index of the WebView running the test to verbose log
statements (which is enabled in CI).
2025-10-02 11:12:47 -04:00
Timothy Flynn
9684e6dbc5 LibWebView+UI: Generate the zoom menu 2025-09-11 14:23:45 -04:00
Timothy Flynn
98c7a011d4 test-web: Wait for crash tests with a test-wait attribute
Similar to ref tests, we don't want to incorrectly pass a test that did
not remove this attribute.
2025-09-10 16:38:24 +01:00
Timothy Flynn
e36cd6d82d Tests/LibWeb: Ensure SIGINT causes test-web to exit with a non-zero code
Sending a ctrl+c to a program should generally cause it to exit with a
non-zero status code.
2025-08-28 13:25:33 +02:00
Jelle Raaijmakers
f9888b0641 Tests: Report view's test path instead of URL in test-web
When a test is active in a test-web view, show the relative path to the
test instead of the view's URL. This gives a better starting point for
debugging than whatever the last loaded URL happened to be.

If no test is active, we still show the view's URL.
2025-08-26 19:37:16 -04:00
rmg-x
ac755d0916 Tests/LibWeb: Reset zoom on web view before running tests
This prevents test failures when running locally if the user set a
default zoom level other than 1.0
2025-08-26 06:31:22 -04:00
Jelle Raaijmakers
bee0ba2bb4 Tests: Report status on SIGINT and SIGTERM in LibWeb test runner
If you interrupt the test runner (Ctrl+C, SIGINT) or if the test runner
is gracefully being terminated (SIGTERM), it now reports the current
status of all the spawned views with their URL and, if an active test is
still being run, the time since the start of the test.

Hopefully this will help gain insight into which tests are hanging.
2025-08-17 20:51:56 -04:00
Sam Atkins
9b6c26e347 Tests: Include test URL in fuzzy mismatch reports
The test logs tend to get a bit mixed together, so this makes it
possible to identify which values correspond to which test when multiple
are failing at once.
2025-08-06 13:51:36 +02:00
Sam Atkins
90b49b9015 Tests: Report what the fuzzy configuration parsing error was 2025-08-06 13:51:36 +02:00
Tim Ledbetter
168ea88cb2 test-web: Add an option to randomize the test order 2025-07-28 09:01:56 +02:00
Tim Ledbetter
bd83f5bde6 test-web: Treat files in images directories as resources for WPT tests 2025-07-20 16:26:57 +12:00
Jelle Raaijmakers
59a867d3e3 Tests: Enable all screenshot tests on all platforms
Some checks failed
Package the js repl as a binary artifact / Linux, arm64 (push) Has been cancelled
Package the js repl as a binary artifact / macOS, arm64 (push) Has been cancelled
Package the js repl as a binary artifact / Linux, x86_64 (push) Has been cancelled
Label PRs with merge conflicts / auto-labeler (push) Has been cancelled
Nightly Lagom / Linux, arm64, Distribution, Clang (push) Has been cancelled
Nightly Lagom / macOS, arm64, Distribution, Clang (push) Has been cancelled
Nightly Lagom / Linux, arm64, Sanitizer, Clang (push) Has been cancelled
Nightly Lagom / macOS, arm64, Sanitizer, Swift (push) Has been cancelled
Nightly Lagom / Linux, x86_64, Distribution, GNU (push) Has been cancelled
Nightly Lagom / Linux, x86_64, Sanitizer, Swift (push) Has been cancelled
Nightly Lagom / Windows, x86_64, Windows_Sanitizer_CI, ClangCL (push) Has been cancelled
Close stale PRs / stale (push) Has been cancelled
With the newly supported fuzzy matching in our test-web runner, we can
now define the expected maximum color channel and pixel count errors per
failing test and set a baseline they should not exceed.

The figures I added to these tests all come from my macOS M4 machine.
Most discrepancies seem to come from color calculations being slightly
off.
2025-07-17 12:59:11 +01:00
Jelle Raaijmakers
0d856a8fa7 Tests: Implement fuzzy screenshot comparisons in test-web
We now read WPT's `<meta name="fuzzy">` tags if present in tests and
apply them while comparing screenshots.
2025-07-17 12:59:11 +01:00
Jelle Raaijmakers
e4b2253b63 Tests: Replace load-reference-page debug action with internals method
WPT reference tests can add metadata to tests to instruct the test
runner how to interpret the results. Because of this, it is not enough
to have an action that starts loading the (mis)match reference: we need
the test runner to receive the metadata so it can act accordingly.

This sets our test runner up for potentially supporting multiple
(mis)match references, and fuzzy rendering matches - the latter will be
implemented in the following commit.
2025-07-17 12:59:11 +01:00
Jelle Raaijmakers
0f642ecb5c LibGfx: Replace Bitmap::visually_equals() with ::diff()
This produces more granural information on the actual pixel errors
present between two bitmaps. It now also asserts that both bitmaps are
the same size, since we should never compare two differently sized
bitmaps anyway.
2025-07-17 12:59:11 +01:00
Jelle Raaijmakers
616a2af23d Tests: Enable screenshot tests on arm64
Of the available 71 screenshot tests that we have, 42 fail on macOS
arm64. Let's make it possible to skip those and run the remaining
succeeding screenshot tests on arm64 anyway.
2025-07-16 08:36:14 +02:00
Tim Ledbetter
e1f0284fba test-web: Wait longer before completing crash tests
Previously, a lot of imported WPT crash tests wouldn't wait long
enough for a crash to occur.
2025-07-14 13:05:17 -04:00
Andreas Kling
dab1fd265d test-web: Dump stacking context tree in layout test output
This will allow us to test (and catch regressions in) stacking context
tree construction and updates, etc.
2025-07-09 14:36:08 +02:00
Jelle Raaijmakers
ead0a2c78a Everywhere: Rename serenity_main to ladybird_main
No functional changes.
2025-07-08 09:17:16 -04:00
Tim Ledbetter
a959d4dca2 test-web: Match WPT runner reftest-wait behavior
When a test has a `reftest-wait` class, we now wait for fonts to load
and then for 2 `requestAnimationFrame` callbacks. This matches the
behavior of the WPT runner and allows more imported WPT tests to work
correctly.
2025-07-02 18:44:21 +02:00
Timothy Flynn
39da2d9a2f LibWebView+UI: Migrate some UI process init to LibWebView
No need to do this setup in every UI's main().
2025-06-11 07:26:32 -04:00
Timothy Flynn
9a5b31ccd1 LibWebView+Tests+UI: Migrate headless-browser to test-web
Now that headless mode is built into the main Ladybird executable, the
headless-browser's only purpose is to run tests. So let's move it to the
testing directory and rename it to test-web (a la test-js / test-wasm).
2025-06-10 12:04:59 -04:00