/**
 * Camera/microphone faking. Chromium has the `--use-fake-device-for-media-stream`
 * launch arg (set in playwright.config.ts) which makes `getUserMedia` succeed
 * with a generated green-rectangle stream. WebKit and Firefox do not — those
 * UA projects skip camera-path tests entirely.
 */
import type { BrowserContext } from '@playwright/test';

export async function grantCameraPermissions(context: BrowserContext, origin: string) {
  await context.grantPermissions(['camera', 'microphone'], { origin });
}

export function isFakeMediaSupported(browserName: string): boolean {
  return browserName === 'chromium';
}
