From 802ae55cc1f4e8d766d60a0d66945b1e07148fa1 Mon Sep 17 00:00:00 2001 From: Karl Seguin Date: Fri, 24 Apr 2026 15:44:33 +0800 Subject: [PATCH] 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). --- .github/workflows/wpt.yml | 7 +------ src/browser/webapi/WebDriver.zig | 6 +++--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/wpt.yml b/.github/workflows/wpt.yml index 89d640ab..229260a9 100644 --- a/.github/workflows/wpt.yml +++ b/.github/workflows/wpt.yml @@ -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 diff --git a/src/browser/webapi/WebDriver.zig b/src/browser/webapi/WebDriver.zig index e432b5d8..9b73d819 100644 --- a/src/browser/webapi/WebDriver.zig +++ b/src/browser/webapi/WebDriver.zig @@ -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 {