mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-02-04 06:23:45 +00:00
Centralizes configuration, eliminates unnecessary copying of config
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user