mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-28 22:53: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 });
|
||||
}
|
||||
|
||||
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.expectSentResult(.{
|
||||
.frameTree = .{
|
||||
.frame = .{
|
||||
.id = bc.frame_id,
|
||||
.id = "TID-3",
|
||||
.loaderId = bc.loader_id,
|
||||
.url = bc.url,
|
||||
.domainAndRegistry = "",
|
||||
|
||||
@@ -147,6 +147,7 @@ const TestContext = struct {
|
||||
|
||||
const BrowserContextOpts = struct {
|
||||
id: ?[]const u8 = null,
|
||||
target_id: ?[]const u8 = null,
|
||||
session_id: ?[]const u8 = null,
|
||||
};
|
||||
pub fn loadBrowserContext(self: *TestContext, opts: BrowserContextOpts) !*main.BrowserContext(TestCDP) {
|
||||
@@ -163,6 +164,10 @@ const TestContext = struct {
|
||||
bc.id = id;
|
||||
}
|
||||
|
||||
if (opts.target_id) |tid| {
|
||||
bc.target_id = tid;
|
||||
}
|
||||
|
||||
if (opts.session_id) |sid| {
|
||||
bc.session_id = sid;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user