Skip to content

Commit aec7455

Browse files
Add Emulation.setDeviceMetricsOverride
Signed-off-by: Francis Bouvier <[email protected]>
1 parent c7ba567 commit aec7455

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/cdp/emulation.zig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const stringify = cdp.stringify;
1010
const EmulationMethods = enum {
1111
setEmulatedMedia,
1212
setFocusEmulationEnabled,
13+
setDeviceMetricsOverride,
1314
};
1415

1516
pub fn emulation(
@@ -24,6 +25,7 @@ pub fn emulation(
2425
return switch (method) {
2526
.setEmulatedMedia => setEmulatedMedia(alloc, id, scanner, ctx),
2627
.setFocusEmulationEnabled => setFocusEmulationEnabled(alloc, id, scanner, ctx),
28+
.setDeviceMetricsOverride => setDeviceMetricsOverride(alloc, id, scanner, ctx),
2729
};
2830
}
2931

@@ -69,3 +71,17 @@ fn setFocusEmulationEnabled(
6971
// TODO: dummy
7072
return result(alloc, id, null, null, sessionID);
7173
}
74+
75+
fn setDeviceMetricsOverride(
76+
alloc: std.mem.Allocator,
77+
id: u64,
78+
scanner: *std.json.Scanner,
79+
_: *Ctx,
80+
) ![]const u8 {
81+
82+
// input
83+
const content = try cdp.getContent(alloc, void, scanner);
84+
85+
// output
86+
return result(alloc, id, null, null, content.sessionID);
87+
}

0 commit comments

Comments
 (0)