Centralizes configuration, eliminates unnecessary copying of config

This commit is contained in:
Nikolay Govorov
2026-01-26 03:22:45 +00:00
parent 068ec68917
commit 0764a44e1d
13 changed files with 836 additions and 742 deletions

View File

@@ -38,9 +38,10 @@ pub fn reset() void {
const App = @import("App.zig");
const js = @import("browser/js/js.zig");
const Config = @import("Config.zig");
const Page = @import("browser/Page.zig");
const Browser = @import("browser/Browser.zig");
const Session = @import("browser/Session.zig");
const Page = @import("browser/Page.zig");
// Merged std.testing.expectEqual and std.testing.expectString
// can be useful when testing fields of an anytype an you don't know
@@ -449,15 +450,21 @@ const Server = @import("Server.zig");
var test_cdp_server: ?Server = null;
var test_http_server: ?TestHTTPServer = null;
const test_config = Config{
.mode = .{ .serve = .{
.common = .{
.tls_verify_host = false,
.user_agent_suffix = "internal-tester",
},
} },
.exec_name = "test",
};
test "tests:beforeAll" {
log.opts.level = .warn;
log.opts.format = .pretty;
test_app = try App.init(@import("root").tracking_allocator, .{
.run_mode = .serve,
.tls_verify_host = false,
.user_agent = "User-Agent: Lightpanda/1.0 internal-tester",
});
test_app = try App.init(@import("root").tracking_allocator, &test_config);
errdefer test_app.deinit();
test_browser = try Browser.init(test_app);