Share the HTTP client globally

This commit is contained in:
Karl Seguin
2025-03-19 10:53:26 +08:00
parent 9fe10747ce
commit ba8a0179d5
8 changed files with 82 additions and 60 deletions

View File

@@ -118,7 +118,7 @@ const TestCDP = main.CDPT(struct {
});
const TestContext = struct {
app: App,
app: *App,
client: ?Client = null,
cdp_: ?TestCDP = null,
arena: std.heap.ArenaAllocator,
@@ -136,7 +136,7 @@ const TestContext = struct {
self.client = Client.init(self.arena.allocator());
// Don't use the arena here. We want to detect leaks in CDP.
// The arena is only for test-specific stuff
self.cdp_ = TestCDP.init(&self.app, &self.client.?);
self.cdp_ = TestCDP.init(self.app, &self.client.?);
}
return &self.cdp_.?;
}