mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 04:34:44 +00:00
Use per-cdp connection HttpClient
This commit is contained in:
@@ -39,6 +39,7 @@ pub fn reset() void {
|
||||
const App = @import("App.zig");
|
||||
const js = @import("browser/js/js.zig");
|
||||
const Config = @import("Config.zig");
|
||||
const Client = @import("http/Client.zig");
|
||||
const Page = @import("browser/Page.zig");
|
||||
const Browser = @import("browser/Browser.zig");
|
||||
const Session = @import("browser/Session.zig");
|
||||
@@ -334,6 +335,7 @@ fn isJsonValue(a: std.json.Value, b: std.json.Value) bool {
|
||||
}
|
||||
|
||||
pub var test_app: *App = undefined;
|
||||
pub var test_http: *Client = undefined;
|
||||
pub var test_browser: Browser = undefined;
|
||||
pub var test_notification: *Notification = undefined;
|
||||
pub var test_session: *Session = undefined;
|
||||
@@ -472,7 +474,10 @@ test "tests:beforeAll" {
|
||||
test_app = try App.init(test_allocator, &test_config);
|
||||
errdefer test_app.deinit();
|
||||
|
||||
test_browser = try Browser.init(test_app, .{});
|
||||
test_http = try test_app.http.createClient(test_allocator);
|
||||
errdefer test_http.deinit();
|
||||
|
||||
test_browser = try Browser.init(test_app, .{ .http_client = test_http });
|
||||
errdefer test_browser.deinit();
|
||||
|
||||
// Create notification for testing
|
||||
@@ -519,6 +524,7 @@ test "tests:afterAll" {
|
||||
|
||||
test_notification.deinit();
|
||||
test_browser.deinit();
|
||||
test_http.deinit();
|
||||
test_app.deinit();
|
||||
test_config.deinit(@import("root").tracking_allocator);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user