Update WebDriver to use Page

Don't use pre-built snapshot for wpt action (the snapshot needs the WebDriver
added, which is not normally added). Instead, rely on runtime snapshot creation
(this just adds a bit of startup time and peak memory, neither or which should
be an issue for WPT runs).
This commit is contained in:
Karl Seguin
2026-04-24 15:44:33 +08:00
parent 3f0cc7a0df
commit 802ae55cc1
2 changed files with 4 additions and 9 deletions

View File

@@ -36,13 +36,8 @@ jobs:
os: ${{env.OS}}
arch: ${{env.ARCH}}
- uses: ./.github/actions/v8-snapshot
with:
os: ${{env.OS}}
arch: ${{env.ARCH}}
- name: zig build release
run: zig build -Dsnapshot_path=../../snapshot.bin -Dprebuilt_v8_path=v8/libc_v8.a -Doptimize=ReleaseFast -Dcpu=generic
run: zig build -Dwpt_extensions -Dprebuilt_v8_path=v8/libc_v8.a -Doptimize=ReleaseFast -Dcpu=generic
- name: upload artifact
uses: actions/upload-artifact@v7

View File

@@ -19,15 +19,15 @@
const std = @import("std");
const js = @import("../js/js.zig");
const Session = @import("../Session.zig");
const Page = @import("../Page.zig");
// This type is only included when the binary is built with the -Dwpt_extensions flag
const WebDriver = @This();
_pad: bool = false,
pub fn deleteAllCookies(_: *const WebDriver, session: *Session) void {
session.cookie_jar.clearRetainingCapacity();
pub fn deleteAllCookies(_: *const WebDriver, page: *Page) void {
page.session.cookie_jar.clearRetainingCapacity();
}
pub const JsApi = struct {