Commit Graph

61 Commits

Author SHA1 Message Date
Pierre Tachoire
80348ef190 fix wpt tests with platform requirement 2025-07-03 09:48:59 -07:00
Karl Seguin
55e02f01dc fix wpt runner 2025-06-23 16:47:31 +08:00
sjorsdonkers
0c0ddc10ee rename scope jscontext
Some checks failed
e2e-test / zig build release (push) Has been cancelled
zig-test / zig build dev (push) Has been cancelled
zig-test / zig test (push) Has been cancelled
e2e-test / puppeteer-perf (push) Has been cancelled
e2e-test / demo-scripts (push) Has been cancelled
e2e-test / cdp-and-hyperfine-bench (push) Has been cancelled
e2e-test / perf-fmt (push) Has been cancelled
zig-test / browser fetch (push) Has been cancelled
zig-test / perf-fmt (push) Has been cancelled
nightly build / build-linux-x86_64 (push) Has been cancelled
nightly build / build-linux-aarch64 (push) Has been cancelled
nightly build / build-macos-aarch64 (push) Has been cancelled
nightly build / build-macos-x86_64 (push) Has been cancelled
wpt / web platform tests json output (push) Has been cancelled
wpt / perf-fmt (push) Has been cancelled
2025-06-13 10:30:50 +02:00
Karl Seguin
7d9951aa3c Replace SessionState directly with the Page. 2025-05-27 20:31:34 +08:00
sjorsdonkers
967ab18d53 default:blank as default document 2025-05-21 09:43:15 +02:00
sjorsdonkers
76f1fcb634 dedup document 2025-05-19 11:35:29 +02:00
Pierre Tachoire
95ee78b1bd wpt: use local url for wpt tests 2025-05-07 09:43:18 +02:00
Karl Seguin
01aa826a24 Make intervals easier and faster, add window.setInterval and clearInterval
When the browser microtask was added, zig-specific timeout functions were
added to the loop. This was necessary for two reasons:
1 - The existing functions were JS specific
2 - We wanted a different reset counter for JS and Zig

Like we did in https://github.com/lightpanda-io/browser/pull/577, the loop is
now JS-agnostic. It gets a Zig callback, and the Zig callback can execute JS
(or do whatever). An intrusive node, like with events, is used to minimize
allocations.

Also, because the microtask was recently moved to the page, there is no longer
a need for separate event counters. All timeouts are scoped to the page.

The new timeout callback can now be used to efficiently reschedule a task. This
reuses the IO.completion and Context, avoiding 2 allocations. More importantly
it makes the internal timer_id static for the lifetime of an "interval". This
is important for window.setInterval, where the callback can itself clear the
interval, which we would need to detect in the callback handler to avoid
re-scheduling. With the stable timer_id, the existing cancel mechanism works
as expected.

The loop no longer has a cbk_error. Callback code is expected to try/catch
callbacks (or use callback.tryCall) and handle errors accordingly.
2025-05-05 19:03:45 +08:00
Karl Seguin
d9f21e0475 add empty cases to empty test suite (#594)
Some checks failed
e2e-test / zig build release (push) Has been cancelled
wpt / web platform tests (push) Has been cancelled
wpt / web platform tests json output (push) Has been cancelled
zig-test / zig build dev (push) Has been cancelled
zig-test / zig test (push) Has been cancelled
e2e-test / puppeteer-perf (push) Has been cancelled
e2e-test / demo-scripts (push) Has been cancelled
wpt / perf-fmt (push) Has been cancelled
zig-test / browser fetch (push) Has been cancelled
zig-test / perf-fmt (push) Has been cancelled
nightly build / build-linux-x86_64 (push) Has been cancelled
nightly build / build-linux-aarch64 (push) Has been cancelled
nightly build / build-macos-aarch64 (push) Has been cancelled
nightly build / build-macos-x86_64 (push) Has been cancelled
2025-05-03 14:11:39 +08:00
Karl Seguin
ca3fa3dc40 Rework WPT runner (#589)
Some checks failed
e2e-test / zig build release (push) Has been cancelled
e2e-test / puppeteer-perf (push) Has been cancelled
e2e-test / demo-scripts (push) Has been cancelled
wpt / web platform tests (push) Has been cancelled
wpt / web platform tests json output (push) Has been cancelled
wpt / perf-fmt (push) Has been cancelled
zig-test / zig build dev (push) Has been cancelled
zig-test / browser fetch (push) Has been cancelled
zig-test / zig test (push) Has been cancelled
zig-test / perf-fmt (push) Has been cancelled
* Rework WPT runner

We have no crashing tests, remove safe mode. Allows better re-use of arenas,
and if we do introduce a crash, it won't be easy to ignore. Could allow for
re-using the environment across tests to further improve performance.

Remove console now that we have a working console api.

* Update workflows, add summary

Remove --safe option from WPT workflows (it's no longer valid)

Include a total test/case summary when --summary or --text (default) is used.

* remove wpt --safe flag from Makefile

* handle tests in the root of the test folder

* Fix a couple possible segfaults base on strange usage (WPT stuff)

* generate proper JSON

* generate proper JSON (for real this time?)

* fix tag type check
2025-05-03 07:53:02 +08:00
Karl Seguin
89fea9b4df initialize ICU
This makes functions like new Intl.DateTimeFormat() not crash.
2025-04-25 13:15:38 +08:00
Karl Seguin
8aa3608a3c Don't [try] to run non-tests
Currently, we treat every .html file in tests/wpt as-if it's a test. That
isn't always the case. wpt has a manifest tool to generate a manifest (in
JSON) of the tests, we should probably use that (but it's quite large).

This PR filters out two groups. First, everything in resources/ appears to
be things to _run_ the tests, not actual tests.

Second, any file without a "testharness.js" doesn't appear to be a test
either. Note that WPT's own manifest generator looks at this:
43a0615361/tools/manifest/sourcefile.py (L676)
(which is used later in the file to determine the type of file).
2025-04-22 21:05:12 +08:00
Karl Seguin
d688d8812d add missing try/catch around loop wait for wpt tests 2025-04-16 19:20:35 +08:00
Karl Seguin
b8d7744563 replace zig-js-runtime 2025-04-15 15:18:04 +08:00
Francis Bouvier
de286dd78e async: use zig-async-io
Signed-off-by: Francis Bouvier <francis@lightpanda.io>
2024-11-21 16:42:48 +01:00
Francis Bouvier
46d0aa6f9e Remove all references to the name 'browsercore'
Signed-off-by: Francis Bouvier <francis@lightpanda.io>
2024-10-29 22:16:56 +01:00
Pierre Tachoire
6da2954e0b upgrade to zig 0.13 2024-07-19 14:32:47 +02:00
Pierre Tachoire
8c3939b842 wpt: remove useless Suite.stack 2024-07-18 16:52:32 +02:00
Pierre Tachoire
4434e11bdd wpt: restore the test results 2024-07-18 16:40:44 +02:00
Francis Bouvier
b8ec53f708 Adapt to js_exec changes in zig-js-runtime
Signed-off-by: Francis Bouvier <francis@lightpanda.io>
2024-07-18 12:10:06 +02:00
Pierre Tachoire
ab31cc0a18 wpt: if no test case found, the suite fails 2024-06-21 16:19:37 +02:00
Pierre Tachoire
c555c325e9 upgrade to zig 0.12
0.12.0-dev.3439+31a7f22b8
2024-06-18 16:13:26 +02:00
Pierre Tachoire
e18d04a799 userctx: inject user context 2024-05-22 14:45:34 +02:00
Pierre Tachoire
2a3a243d1c add AGPL license header in zig files 2024-05-13 20:51:36 +02:00
Pierre Tachoire
fec212ab94 window: use window as global object 2024-03-08 12:24:23 +01:00
Pierre Tachoire
c2ade9061b move window from nav to html 2024-01-17 18:21:52 +01:00
Pierre Tachoire
b53d4a149c add nav web api 2024-01-17 18:21:47 +01:00
Francis Bouvier
a5dfa6cb44 Adopt global Types changes in jsruntime
Signed-off-by: Francis Bouvier <francis@lightpanda.io>
2024-01-10 11:56:53 +01:00
Pierre Tachoire
006aea25b8 wpt: fix normal output 2024-01-03 09:56:56 +01:00
Pierre Tachoire
e04bbc2ace wpt: summary includes pass cases number 2023-12-15 11:58:54 +01:00
Pierre Tachoire
1e739af4e4 wpt: use std.ChildProcess.run 2023-12-15 11:28:28 +01:00
Pierre Tachoire
ee8628acfd wpt: handle json outpout w/ safe run 2023-11-30 17:31:17 +01:00
Pierre Tachoire
73e80a5678 wpt: use enum for output 2023-11-30 17:31:17 +01:00
Pierre Tachoire
29f5f15c50 wpt: move safe run in its own func 2023-11-30 17:31:17 +01:00
Pierre Tachoire
07270fbb19 wpt: extract filter on its own func 2023-11-30 17:31:16 +01:00
Pierre Tachoire
8b8d7b3617 wpt: add safe test run in separate process 2023-11-30 17:31:16 +01:00
Pierre Tachoire
6e0491e3b0 wpt: remove output 2023-11-30 17:31:16 +01:00
Pierre Tachoire
62721e672f wpt: add json output 2023-11-30 17:31:15 +01:00
Pierre Tachoire
49318b18df wpt: use gpa allocator 2023-11-30 17:31:15 +01:00
Pierre Tachoire
d7ddec3ba7 wpt: move code into wpt/ module 2023-11-30 17:31:12 +01:00
Pierre Tachoire
486927c889 wpt: refacto results report 2023-11-30 17:26:08 +01:00
Pierre Tachoire
b55c72c2ed wpt: add json option 2023-11-30 17:26:07 +01:00
Francis Bouvier
2065d47d8e Check DOMError
Signed-off-by: Francis Bouvier <francis@lightpanda.io>
2023-11-28 17:55:49 +01:00
Francis Bouvier
b4951ffa51 Adapt to js_env.start change
Signed-off-by: Francis Bouvier <francis@lightpanda.io>
2023-11-24 19:37:45 +01:00
Francis Bouvier
c751b5f420 Update jsruntime
Signed-off-by: Francis Bouvier <francis@lightpanda.io>
2023-11-21 12:16:51 +01:00
Pierre Tachoire
62fe1c292d wpt: add a console.log debug message 2023-11-16 10:09:00 +01:00
Pierre Tachoire
bd0ade29d2 wpt: use fs.path.join 2023-10-27 19:06:51 +02:00
Pierre Tachoire
89431971ac wpt: load script soruce file dynamically 2023-10-27 19:00:26 +02:00
Francis Bouvier
3c5f1b89e7 Update jsruntime + fix breaking changes
Signed-off-by: Francis Bouvier <francis.bouvier@gmail.com>
2023-10-23 13:03:39 +02:00
Pierre Tachoire
b8efce8f34 wpt: declare FilesMap type in FileLoader struct 2023-10-18 14:08:58 +02:00