Skip to content

Commit e3409a2

Browse files
committed
fix test
1 parent 5182edc commit e3409a2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/cdp/page.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,13 +274,13 @@ test "cdp.page: getFrameTree" {
274274
try ctx.expectSentError(-31998, "BrowserContextNotLoaded", .{ .id = 10 });
275275
}
276276

277-
const bc = try ctx.loadBrowserContext(.{ .id = "BID-9" });
277+
const bc = try ctx.loadBrowserContext(.{ .id = "BID-9", .target_id = "TID-3" });
278278
{
279279
try ctx.processMessage(.{ .id = 11, .method = "Page.getFrameTree" });
280280
try ctx.expectSentResult(.{
281281
.frameTree = .{
282282
.frame = .{
283-
.id = bc.frame_id,
283+
.id = "TID-3",
284284
.loaderId = bc.loader_id,
285285
.url = bc.url,
286286
.domainAndRegistry = "",

src/cdp/testing.zig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ const TestContext = struct {
147147

148148
const BrowserContextOpts = struct {
149149
id: ?[]const u8 = null,
150+
target_id: ?[]const u8 = null,
150151
session_id: ?[]const u8 = null,
151152
};
152153
pub fn loadBrowserContext(self: *TestContext, opts: BrowserContextOpts) !*main.BrowserContext(TestCDP) {
@@ -163,6 +164,10 @@ const TestContext = struct {
163164
bc.id = id;
164165
}
165166

167+
if (opts.target_id) |tid| {
168+
bc.target_id = tid;
169+
}
170+
166171
if (opts.session_id) |sid| {
167172
bc.session_id = sid;
168173
}

0 commit comments

Comments
 (0)