diff --git a/scripts/windows-smoke.mjs b/scripts/windows-smoke.mjs index a757340..1808d1b 100644 --- a/scripts/windows-smoke.mjs +++ b/scripts/windows-smoke.mjs @@ -11,6 +11,7 @@ // instead of failing, so the same script runs on main and on PR branches. import { writeFileSync, mkdirSync } from 'node:fs'; import { execSync } from 'node:child_process'; +import { createServer } from 'node:http'; import { chromium } from 'playwright-core'; const OUT = process.argv[2] || 'smoke-out'; @@ -150,21 +151,38 @@ else if (!kc.supported) record('keychain round trip', 'fail', 'secure_session_su else record('keychain round trip', kc.roundTrip && kc.restored ? 'pass' : 'fail', JSON.stringify(kc)); // 7. A foreign page loaded in the window must not get the microphone (#22). -await page.goto('https://example.com/').catch(() => undefined); -const foreignMic = await page.evaluate(async () => { - try { - const s = await navigator.mediaDevices.getUserMedia({ audio: true }); - s.getTracks().forEach((t) => t.stop()); - return 'ok'; - } catch (e) { - return e.name; - } +// Served locally on another port (a different origin, still a secure context), +// so the check doesn't depend on the runner reaching the internet. +const foreign = createServer((_, res) => { + res.writeHead(200, { 'Content-Type': 'text/html' }); + res.end('