electron/spec-main/fixtures/crash-cases/quit-on-crashed-event/index.js
stephen9357 e3fe80e0e8
fix: increase stack size on windows x86 (#29474)
* fix: increace main thread stack size on windows x86

* chore: improve quit-on-crashed-event spec

* chore: add debug logs

* Revert "chore: add debug logs"

This reverts commit 0be81ae07c85095ac2c920436b97557c95c1c524.

* chore: use a reliable crash endpoint

Co-authored-by: Stephen Wang <wangwenqiang.wwq@bytedance.com>
Co-authored-by: Deepak Mohan <hop2deep@gmail.com>
2021-07-22 12:49:21 -07:00

19 lines
473 B
JavaScript

const { app, BrowserWindow } = require('electron');
app.once('ready', async () => {
const w = new BrowserWindow({
show: false,
webPreferences: {
contextIsolation: false,
nodeIntegration: true
}
});
w.webContents.once('render-process-gone', (_, details) => {
if (details.reason === 'crashed') {
process.exit(0);
} else {
process.exit(details.exitCode);
}
});
await w.webContents.loadURL('chrome://checkcrash');
});