mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-06-11 01:25:53 -04:00
Introduce Page (container)
Follow up to https://github.com/lightpanda-io/browser/pull/2200 This change is actually pretty mundane, but a bunch of files that used to take a *Session (e.g. every WebAPI releaseRef and deinit) now take a *Page. This aims to separate the 2 lifetimes currently managed by Session by moving the "Page" lifetime to a dedicated container: Page. Ultimately, the goal is to remove the 1-page-per-session limit of the current design. Not to explicitly support multiple pages per session (though, that's more possible now), but in order to better emulate Chrome where, during a navigation event, the old and new page both exist.
This commit is contained in:
@@ -394,8 +394,8 @@ pub fn htmlRunner(comptime path: []const u8, opts: HtmlRunnerOpts) !void {
|
||||
}
|
||||
|
||||
fn runWebApiTest(test_file: [:0]const u8) !void {
|
||||
const frame = try test_session.createFrame();
|
||||
defer test_session.removeFrame();
|
||||
const frame = try test_session.createPage();
|
||||
defer test_session.removePage();
|
||||
|
||||
const url = try std.fmt.allocPrintSentinel(
|
||||
arena_allocator,
|
||||
@@ -453,8 +453,8 @@ const PageTestOpts = struct {
|
||||
wait_until_done: bool = true,
|
||||
};
|
||||
pub fn pageTest(comptime test_file: []const u8, opts: PageTestOpts) !*Frame {
|
||||
const frame = try test_session.createFrame();
|
||||
errdefer test_session.removeFrame();
|
||||
const frame = try test_session.createPage();
|
||||
errdefer test_session.removePage();
|
||||
|
||||
const url = try std.fmt.allocPrintSentinel(
|
||||
arena_allocator,
|
||||
|
||||
Reference in New Issue
Block a user