mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13:28 +00:00
fix test
This commit is contained in:
@@ -274,13 +274,13 @@ test "cdp.page: getFrameTree" {
|
|||||||
try ctx.expectSentError(-31998, "BrowserContextNotLoaded", .{ .id = 10 });
|
try ctx.expectSentError(-31998, "BrowserContextNotLoaded", .{ .id = 10 });
|
||||||
}
|
}
|
||||||
|
|
||||||
const bc = try ctx.loadBrowserContext(.{ .id = "BID-9" });
|
const bc = try ctx.loadBrowserContext(.{ .id = "BID-9", .target_id = "TID-3" });
|
||||||
{
|
{
|
||||||
try ctx.processMessage(.{ .id = 11, .method = "Page.getFrameTree" });
|
try ctx.processMessage(.{ .id = 11, .method = "Page.getFrameTree" });
|
||||||
try ctx.expectSentResult(.{
|
try ctx.expectSentResult(.{
|
||||||
.frameTree = .{
|
.frameTree = .{
|
||||||
.frame = .{
|
.frame = .{
|
||||||
.id = bc.frame_id,
|
.id = "TID-3",
|
||||||
.loaderId = bc.loader_id,
|
.loaderId = bc.loader_id,
|
||||||
.url = bc.url,
|
.url = bc.url,
|
||||||
.domainAndRegistry = "",
|
.domainAndRegistry = "",
|
||||||
|
|||||||
@@ -147,6 +147,7 @@ const TestContext = struct {
|
|||||||
|
|
||||||
const BrowserContextOpts = struct {
|
const BrowserContextOpts = struct {
|
||||||
id: ?[]const u8 = null,
|
id: ?[]const u8 = null,
|
||||||
|
target_id: ?[]const u8 = null,
|
||||||
session_id: ?[]const u8 = null,
|
session_id: ?[]const u8 = null,
|
||||||
};
|
};
|
||||||
pub fn loadBrowserContext(self: *TestContext, opts: BrowserContextOpts) !*main.BrowserContext(TestCDP) {
|
pub fn loadBrowserContext(self: *TestContext, opts: BrowserContextOpts) !*main.BrowserContext(TestCDP) {
|
||||||
@@ -163,6 +164,10 @@ const TestContext = struct {
|
|||||||
bc.id = id;
|
bc.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (opts.target_id) |tid| {
|
||||||
|
bc.target_id = tid;
|
||||||
|
}
|
||||||
|
|
||||||
if (opts.session_id) |sid| {
|
if (opts.session_id) |sid| {
|
||||||
bc.session_id = sid;
|
bc.session_id = sid;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user