--- electron/spec/api-crash-reporter-spec.ts.orig 2024-01-29 19:56:59 UTC +++ electron/spec/api-crash-reporter-spec.ts @@ -11,7 +11,7 @@ const isWindowsOnArm = process.platform === 'win32' && import { setTimeout } from 'timers/promises'; const isWindowsOnArm = process.platform === 'win32' && process.arch === 'arm64'; -const isLinuxOnArm = process.platform === 'linux' && process.arch.includes('arm'); +const isLinuxOnArm = ((process.platform === 'linux' || process.platform === 'freebsd') && process.arch.includes('arm')); type CrashInfo = { prod: string @@ -44,7 +44,7 @@ function checkCrash (expectedProcessType: string, fiel // TODO(nornagon): minidumps are sometimes (not always) turning up empty on // 32-bit Linux. Figure out why. - if (!(process.platform === 'linux' && process.arch === 'ia32')) { + if (!((process.platform === 'linux' || process.platform === 'freebsd') && process.arch === 'ia32')) { expect(fields.upload_file_minidump.length).to.be.greaterThan(0); } } @@ -181,7 +181,7 @@ ifdescribe(!isLinuxOnArm && !process.mas && !process.e // Ensures that passing in crashpadHandlerPID flag for Linx child processes // does not affect child proocess args. - ifit(process.platform === 'linux')('ensure linux child process args are not modified', async () => { + ifit(process.platform === 'linux' || process.platform === 'freebsd')('ensure linux child process args are not modified', async () => { const { port, waitForCrash } = await startServer(); let exitCode: number | null = null; const appPath = path.join(__dirname, 'fixtures', 'apps', 'crash'); @@ -530,7 +530,7 @@ ifdescribe(!isLinuxOnArm && !process.mas && !process.e } } - const processList = process.platform === 'linux' ? ['main', 'renderer', 'sandboxed-renderer'] + const processList = (process.platform === 'linux' || process.platform === 'freebsd') ? ['main', 'renderer', 'sandboxed-renderer'] : ['main', 'renderer', 'sandboxed-renderer', 'node']; for (const crashingProcess of processList) { describe(`when ${crashingProcess} crashes`, () => { @@ -542,7 +542,7 @@ ifdescribe(!isLinuxOnArm && !process.mas && !process.e return app.getPath('crashDumps'); }); let reportsDir = crashesDir; - if (process.platform === 'darwin' || process.platform === 'linux') { + if (process.platform === 'darwin' || process.platform === 'linux' || process.platform === 'freebsd') { reportsDir = path.join(crashesDir, 'completed'); } else if (process.platform === 'win32') { reportsDir = path.join(crashesDir, 'reports'); @@ -566,7 +566,7 @@ ifdescribe(!isLinuxOnArm && !process.mas && !process.e expect(remoteCrashesDir).to.equal(crashesDir); let reportsDir = crashesDir; - if (process.platform === 'darwin' || process.platform === 'linux') { + if (process.platform === 'darwin' || process.platform === 'linux' || process.platform === 'freebsd') { reportsDir = path.join(crashesDir, 'completed'); } else if (process.platform === 'win32') { reportsDir = path.join(crashesDir, 'reports');