Merge pull request #1927 from lightpanda-io/feat/fetch-wait-options

Feat/fetch wait options
This commit is contained in:
Karl Seguin
2026-03-21 07:18:59 +08:00
committed by GitHub
10 changed files with 91 additions and 31 deletions

View File

@@ -131,7 +131,7 @@ pub fn CDPT(comptime TypeProvider: type) type {
// timeouts (or http events) which are ready to be processed.
pub fn pageWait(self: *Self, ms: u32) Session.WaitResult {
const session = &(self.browser.session orelse return .no_page);
return session.wait(ms);
return session.wait(.{ .timeout_ms = ms });
}
// Called from above, in processMessage which handles client messages

View File

@@ -288,7 +288,7 @@ test "cdp.lp: action tools" {
const page = try bc.session.createPage();
const url = "http://localhost:9582/src/browser/tests/mcp_actions.html";
try page.navigate(url, .{ .reason = .address_bar, .kind = .{ .push = null } });
_ = bc.session.wait(5000);
_ = bc.session.wait(.{});
// Test Click
const btn = page.document.getElementById("btn", page).?.asNode();

View File

@@ -136,7 +136,7 @@ const TestContext = struct {
0,
);
try page.navigate(full_url, .{});
_ = bc.session.wait(2000);
_ = bc.session.wait(.{});
}
return bc;
}