mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-10-03 02:57:55 +00:00
30 lines
1.1 KiB
TypeScript
30 lines
1.1 KiB
TypeScript
import { readFileSync } from "node:fs";
|
|
import { fileURLToPath } from "node:url";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
const windowsSource = readFileSync(fileURLToPath(new URL("./windows.ts", import.meta.url)), "utf8");
|
|
const mainSource = readFileSync(fileURLToPath(new URL("./main.ts", import.meta.url)), "utf8");
|
|
const recordingSource = readFileSync(
|
|
fileURLToPath(new URL("./ipc/register/recording.ts", import.meta.url)),
|
|
"utf8",
|
|
);
|
|
|
|
describe("HUD capture protection lifecycle", () => {
|
|
it("applies protection without disabling Linux", () => {
|
|
expect(windowsSource).not.toContain(
|
|
"function isHudOverlayCaptureProtectionSupported(): boolean",
|
|
);
|
|
expect(windowsSource).toContain("hud.setContentProtection(enabled)");
|
|
expect(windowsSource).toContain('win.on("show"');
|
|
});
|
|
|
|
it("reasserts protection at native and browser capture boundaries", () => {
|
|
expect(recordingSource).toMatch(
|
|
/"start-native-screen-recording"[\s\S]*?reassertHudOverlayCaptureProtection\(\)/,
|
|
);
|
|
expect(mainSource).toMatch(
|
|
/setDisplayMediaRequestHandler[\s\S]*?reassertHudOverlayCaptureProtection\(\)/,
|
|
);
|
|
});
|
|
});
|