| 257 | } |
| 258 | |
| 259 | export function runRecordingInspect(params: { |
| 260 | videoPath: string; |
| 261 | telemetryPath: string; |
| 262 | outputDir: string; |
| 263 | }): RecordingInspectionManifest { |
| 264 | mkdirSync(params.outputDir, { recursive: true }); |
| 265 | const scriptPath = path.resolve('test/integration/support/recording-inspect.swift'); |
| 266 | const result = runCmdSync( |
| 267 | 'xcrun', |
| 268 | [ |
| 269 | 'swift', |
| 270 | scriptPath, |
| 271 | '--input', |
| 272 | params.videoPath, |
| 273 | '--events', |
| 274 | params.telemetryPath, |
| 275 | '--output-dir', |
| 276 | params.outputDir, |
| 277 | ], |
| 278 | { allowFailure: true, timeoutMs: RECORDING_INSPECT_TIMEOUT_MS }, |
| 279 | ); |
| 280 | assert.equal(result.exitCode, 0, result.stderr || result.stdout || 'recording inspect failed'); |
| 281 | const manifestPath = path.join(params.outputDir, 'manifest.json'); |
| 282 | return JSON.parse(readFileSync(manifestPath, 'utf8')) as RecordingInspectionManifest; |
| 283 | } |
| 284 | |
| 285 | export function analyzeOverlayCrop(cropPath: string): OverlayCropAnalysis { |
| 286 | const png = PNG.sync.read(readFileSync(cropPath)); |