Commit graph

29 commits

Author SHA1 Message Date
Shannon Booth
2072eee83d LibURL: Implement create_with_file_scheme using URL Parser
Creating a URL should almost always go through the URLParser to
handle all of the small edge cases involved. This reduces the
need for URL valid state.
2025-04-19 07:18:43 -04:00
Andrew Kaster
91b549f797 LibGfx+LibWebView+UI: Store Gfx::Bitmap in RefPtr to const 2025-04-16 10:41:44 -06:00
stasoid
a821fc03be Headless: Compile on Windows 2025-04-13 10:19:23 -06:00
Aliaksandr Kalenik
259d39cbad UI/Headless: Wait for "reftest-wait" class removal before screenshotting
Resolves https://github.com/LadybirdBrowser/ladybird/issues/3984
2025-03-18 20:09:46 +01:00
Aliaksandr Kalenik
394073f611 LibWeb: Rename internals.signalTextTestIsDone() to signalTestIsDone()
In upcoming change this function will be used for ref-tests as well.
2025-03-18 20:09:46 +01:00
Timothy Flynn
cf523137ad headless-browser: Do not log the inner text of crash tests
This re-implements 533c8e910a without
breaking the ability to dump layout trees.
2025-03-02 11:49:49 -05:00
Timothy Flynn
1aa009b0cf Revert "headless-browser: Do not log the inner text of crash tests"
This reverts commit 533c8e910a.

This broke the ability to dump layout trees using headless-browser.
2025-03-02 11:49:49 -05:00
Timothy Flynn
533c8e910a headless-browser: Do not log the inner text of crash tests
This information is not particularly interesting, and it can be quite
verbose (such as style-propagation-for-long-continuation-chain.html,
which would log hundreds of lines of "a"s and "b"s).
2025-02-24 08:07:24 -05:00
Andrew Kaster
7ed4557573 UI: Only run Screenshot tests on x86_64 Linux
These were previously skipped on macOS, due to hard to
fix inconsistencies in the exact produced pixels.

Turns out, this is not just a macOS thing. The same sort
of hard-to-spot slight pixel deviations are present on
arm64 Linux as well.
2025-02-17 12:36:26 +01:00
Shannon Booth
9072a7caef Everywhere: Use URL::about_XXX factory functions 2025-02-15 17:05:55 +00:00
Shannon Booth
67f435975b headless-browser: Fix crash test globbing
Tests have the glob run against the relative path of the test file.
Since this was never set for crash tests the '-f' argument to
headless browser would never match the global against any crash test.
2025-02-10 09:25:09 +00:00
Tim Ledbetter
39e17e83f9 headless-browser: Allow the -f argument to be used multiple times
A test path is now included if it matches any of the given globs.
2025-02-05 06:58:52 -05:00
InvalidUsernameException
5cc9a5802d LibWeb+UI: Add internals API to set browser zoom 2025-01-21 16:05:12 +01:00
Timothy Flynn
43dc0f52a6 LibWeb: Do not run microtasks when the event loop is paused
For example, running `alert(1)` will pause the event loop, during which
time no JavaScript should execute. This patch extends this disruption to
microtasks. This avoids a crash inside the microtask executor, which
asserts the JS execution context stack is empty.

This makes us behave the same as Firefox in the following page:

    <script>
        queueMicrotask(() => {
            console.log("inside microtask");
        });

        alert("hi");
    </script>

Before the aforementioned assertion was added, we would execute that
microtask before showing the alert. Firefox does not do this, and now
we don't either.
2025-01-19 20:47:50 +00:00
Tim Ledbetter
bef7e704c5 headless-browser: Add support for crash tests
These are essentially the same as text tests, but they have no
associated expectation file. These tests pass if the test fully loads
without crashing.
2025-01-17 09:08:15 +01:00
Tim Ledbetter
c55d40e84b UI/Headless: Ignore more WPT support files
We now ignore files imported from WPT, if they are in the root `common`
directory, or any directory named `resources`. This matches the
behavior of the WPT test harness.
2024-12-29 01:20:48 +00:00
Sam Atkins
be6a9940ad headless-browser: Let tests set their own timeout duration
Some tests take longer than others, and so may want to set a custom
timeout so that they pass, without increasing the timeout for all other
tests. For example, this is done in WPT.

Add an `internals.setTestTimeout(milliseconds)` method that overrides
the test runner's default timeout for the currently-run test.
2024-12-19 17:27:33 +00:00
Lucas CHOLLET
8a0c63f168 headless-browser: Stop considering support files from WPT as tests 2024-12-19 09:54:14 +00:00
Tim Ledbetter
2455618995 WebContent+headless-browser: Implement mismatch conditions for ref tests
Ref tests can now have a `<link rel="mismatch">` condition. The test
will pass if the expectation page doesn't match the test page.
2024-12-04 19:50:00 +00:00
Timothy Flynn
ad5de9d4e5 headless-browser: Add an option to log per-test durations
This adds a verbosity option to log the start and end of each test, with
the duration taken for the test. To be able to use this option with our
exisiting verbosity flag, without cluttering stdout with other data, we
add verbosity levels to headless-browser. The level is increased by
providing the -v flag on the command line multiple times.
2024-11-30 12:10:12 -05:00
Timothy Flynn
49eeaaf8fe headless-browser: Store each test's relative path on the Test object
Rather than having to compute it each time we want it.
2024-11-30 12:10:12 -05:00
Tim Ledbetter
2aee5d7f62 headless-browser: Treat files ending in '.htm' as valid tests 2024-11-21 15:49:48 -05:00
Timothy Flynn
077ae6efa1 headless-browser: Create the expectation directory if it doesn't exist
This is convenient when adding tests to a new folder.
2024-11-17 22:37:45 +01:00
Timothy Flynn
25c067872c headless-browser: Ensure crashing tests cause LibWeb tests to fail 2024-11-13 19:21:57 -05:00
Timothy Flynn
71ccaeda16 headless-browser: Store the viewport size as DevicePixelSize
This will just avoid a bunch of needless conversion to/from IntSize in
and upcoming commit.
2024-11-13 11:01:01 +01:00
Timothy Flynn
70ce8046c3 headless-browser: Handle WebContent crashes similar to the graphical UIs
Instead of bringing the whole browser down, let's re-initialize the
WebContent client so we can move on. This is particularly needed for
WPT.
2024-11-12 14:25:59 +00:00
Timothy Flynn
aa0811d24e headless-browser: Do not log skipped tests by default
We now skip so many tests that the list of skipped tests exceeds the
height of my terminal. Let's skip logging these by default, as it is
too noisy to find actually relevant information.
2024-11-11 16:54:55 +01:00
Timothy Flynn
d2306efaea headless-browser: Replace the log-slowest-tests flag with a verbose flag
Instead of adding a separate flag for each thing we want to log, let's
just have a verbosity flag. We can add verbosity levels later if needed.
2024-11-11 16:54:55 +01:00
Timothy Flynn
db47cc41f8 Everywhere: Move the Ladybird folder to UI 2024-11-10 12:50:45 +01:00
Renamed from Ladybird/Headless/Test.cpp (Browse further)