mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 23:23:28 +00:00
Merge pull request #441 from karlseguin/cdp_tests
Some checks are pending
e2e-test / zig build release (push) Waiting to run
e2e-test / puppeteer (push) Blocked by required conditions
wpt / web platform tests (push) Waiting to run
wpt / perf-fmt (push) Blocked by required conditions
zig-test / zig build dev (push) Waiting to run
zig-test / zig test (push) Waiting to run
zig-test / perf-fmt (push) Blocked by required conditions
Some checks are pending
e2e-test / zig build release (push) Waiting to run
e2e-test / puppeteer (push) Blocked by required conditions
wpt / web platform tests (push) Waiting to run
wpt / perf-fmt (push) Blocked by required conditions
zig-test / zig build dev (push) Waiting to run
zig-test / zig test (push) Waiting to run
zig-test / perf-fmt (push) Blocked by required conditions
Turn CDP into a generic so that mocks can be injected for testing
This commit is contained in:
@@ -638,7 +638,7 @@ fn ClientT(comptime S: type, comptime C: type) type {
|
||||
self.server.queueClose(self.socket);
|
||||
return false;
|
||||
},
|
||||
.text, .binary => if (self.cdp.?.processMessage(msg.data) == false) {
|
||||
.text, .binary => if (self.cdp.?.handleMessage(msg.data) == false) {
|
||||
self.close(null);
|
||||
return false;
|
||||
},
|
||||
@@ -1792,7 +1792,7 @@ const MockCDP = struct {
|
||||
self.messages.deinit(allocator);
|
||||
}
|
||||
|
||||
fn processMessage(self: *MockCDP, message: []const u8) bool {
|
||||
fn handleMessage(self: *MockCDP, message: []const u8) bool {
|
||||
const owned = self.allocator.dupe(u8, message) catch unreachable;
|
||||
self.messages.append(self.allocator, owned) catch unreachable;
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user