Skip to content

Commit 9120b9c

Browse files
Add emulation.setTouchEmulationEnabled
Signed-off-by: Francis Bouvier <[email protected]>
1 parent 08c11ac commit 9120b9c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/cdp/emulation.zig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const EmulationMethods = enum {
1111
setEmulatedMedia,
1212
setFocusEmulationEnabled,
1313
setDeviceMetricsOverride,
14+
setTouchEmulationEnabled,
1415
};
1516

1617
pub fn emulation(
@@ -26,6 +27,7 @@ pub fn emulation(
2627
.setEmulatedMedia => setEmulatedMedia(alloc, id, scanner, ctx),
2728
.setFocusEmulationEnabled => setFocusEmulationEnabled(alloc, id, scanner, ctx),
2829
.setDeviceMetricsOverride => setDeviceMetricsOverride(alloc, id, scanner, ctx),
30+
.setTouchEmulationEnabled => setTouchEmulationEnabled(alloc, id, scanner, ctx),
2931
};
3032
}
3133

@@ -84,3 +86,14 @@ fn setDeviceMetricsOverride(
8486
// output
8587
return result(alloc, id orelse msg.id.?, null, null, msg.sessionID);
8688
}
89+
90+
fn setTouchEmulationEnabled(
91+
alloc: std.mem.Allocator,
92+
id: ?u16,
93+
scanner: *std.json.Scanner,
94+
_: *Ctx,
95+
) ![]const u8 {
96+
const msg = try cdp.getMsg(alloc, void, scanner);
97+
98+
return result(alloc, id orelse msg.id.?, null, null, msg.sessionID);
99+
}

0 commit comments

Comments
 (0)