Files
Recordly/electron/ipc/windowsCaptureSelection.test.ts
webadderall 8abceaa914 feat: add H.264 stream-copy export, overhaul exporter pipeline, rename native binaries
- IPC: new inputMode 'h264-stream' — browser VideoEncoder output stream-copied
  into MP4 via ffmpeg rather than piping raw RGBA frames, cuts memory usage
- Security: replace flat approvedLocalReadPaths with userApprovedPaths fed from
  dialog pickers and project load; isAllowedLocalReadPath uses it alongside
  dir prefix / existsSync checks
- nativeVideoExport: add buildNativeH264StreamExportArgs for stream-copy path
- frameRenderer / modernFrameRenderer: cursor-follow camera integration,
  annotation blur post-processing, shadow profile, squircle geometry
- audioEncoder / streamingDecoder / gifExporter / muxer: full pipeline
  hardening — drift correction, backpressure, proper teardown
- Rename native helpers openscreen-* → recordly-* on darwin-arm64 and
  darwin-x64; update helpers-manifest.json for win32-x64
- electron/main, windows, updater, rendererServer: startup and window
  lifecycle improvements
- preload: expose inputMode and new IPC surface to renderer
2026-04-16 17:51:41 +10:00

65 lines
1.4 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { resolveWindowsCaptureDisplay } from "./windowsCaptureSelection";
describe("resolveWindowsCaptureDisplay", () => {
const primaryDisplay = {
id: 101,
bounds: {
x: 0,
y: 0,
width: 1920,
height: 1080,
},
};
const secondaryDisplay = {
id: 202,
bounds: {
x: 1920,
y: -40,
width: 2560,
height: 1440,
},
};
it("uses the requested secondary display bounds for WGC fallback metadata", () => {
const resolved = resolveWindowsCaptureDisplay(
{ display_id: String(secondaryDisplay.id) },
[primaryDisplay, secondaryDisplay],
primaryDisplay,
);
expect(resolved).toEqual({
displayId: secondaryDisplay.id,
bounds: secondaryDisplay.bounds,
});
});
it("falls back to the primary display when the source has no display id", () => {
const resolved = resolveWindowsCaptureDisplay(
undefined,
[primaryDisplay, secondaryDisplay],
primaryDisplay,
);
expect(resolved).toEqual({
displayId: primaryDisplay.id,
bounds: primaryDisplay.bounds,
});
});
it("keeps the requested display id even if Electron cannot rematch it, while using primary bounds", () => {
const resolved = resolveWindowsCaptureDisplay(
{ display_id: "303" },
[primaryDisplay, secondaryDisplay],
primaryDisplay,
);
expect(resolved).toEqual({
displayId: 303,
bounds: primaryDisplay.bounds,
});
});
});