@specific.dev/spectest 0.36.1 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.js +26 -0
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -61,11 +61,37 @@ function base64ByteLength(b64) {
|
|
|
61
61
|
// surfaces as an intermittent `net::ERR_NAME_NOT_RESOLVED`. getaddrinfo
|
|
62
62
|
// reads resolv.conf synchronously per lookup, so it has no startup race
|
|
63
63
|
// and always reaches the resolver. See run 878d0054 (dashboard:3000).
|
|
64
|
+
//
|
|
65
|
+
// The two media flags below make `getUserMedia` work at all. The microVM
|
|
66
|
+
// has no camera and no sound card, so without them a page that asks for one
|
|
67
|
+
// fails on `NotFoundError: Requested device not found` — an app that gates
|
|
68
|
+
// its UI on microphone access can't be driven past that point.
|
|
69
|
+
//
|
|
70
|
+
// What the app gets is Chromium's own synthetic devices: the microphone is a
|
|
71
|
+
// generated beep pattern (a live, real MediaStreamTrack — MediaRecorder,
|
|
72
|
+
// WebRTC and AudioContext analysis all work on it), the camera a rolling
|
|
73
|
+
// test pattern at 640x480. There is deliberately NO way to feed a recording
|
|
74
|
+
// in; this is device availability, not audio fixtures.
|
|
75
|
+
//
|
|
76
|
+
// --use-fake-device-for-media-stream: the synthetic camera + microphone.
|
|
77
|
+
// Also what makes `enumerateDevices()` return anything at all.
|
|
78
|
+
// --use-fake-ui-for-media-stream: auto-accept the permission prompt.
|
|
79
|
+
// Headless has no UI to accept it with, so without this `getUserMedia`
|
|
80
|
+
// fails on `NotAllowedError` even when the fake devices are present.
|
|
81
|
+
//
|
|
82
|
+
// `--autoplay-policy=no-user-gesture-required` is deliberately NOT here.
|
|
83
|
+
// WebAudio over the captured stream works without it: holding a live
|
|
84
|
+
// getUserMedia stream is itself one of the conditions under which Chromium
|
|
85
|
+
// lets an AudioContext start, so an app's level meter or VAD reads the fake
|
|
86
|
+
// device fine (measured). Adding it would also un-block ordinary media
|
|
87
|
+
// autoplay, which is a behaviour change in the app under test, not in us.
|
|
64
88
|
const CHROME_ARGV = [
|
|
65
89
|
"--no-sandbox",
|
|
66
90
|
"--disable-dev-shm-usage",
|
|
67
91
|
"--disable-features=AsyncDns,DnsOverHttps",
|
|
68
92
|
"--dns-over-https-mode=off",
|
|
93
|
+
"--use-fake-device-for-media-stream",
|
|
94
|
+
"--use-fake-ui-for-media-stream",
|
|
69
95
|
];
|
|
70
96
|
/** Default touchStart→touchEnd dwell for touch taps — see `rawTap`. */
|
|
71
97
|
const TAP_DWELL_MS = 60;
|