mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
refactor: exit on events instead of on timeout for dialog crash test
Co-authored-by: Robo <hop2deep@gmail.com>
This commit is contained in:
@@ -1,9 +1,22 @@
|
||||
const { app, BrowserWindow } = require('electron');
|
||||
|
||||
process.on('uncaughtException', (err) => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
process.on('unhandledRejection', (reason) => {
|
||||
console.error(reason);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
app.on('browser-window-created', (ev, window) => {
|
||||
window.webContents.once('did-frame-navigate', (ev, url) => {
|
||||
process.exit(0);
|
||||
});
|
||||
});
|
||||
|
||||
app.whenReady().then(() => {
|
||||
const win = new BrowserWindow({ show: false });
|
||||
win.loadFile('index.html');
|
||||
setTimeout(() => {
|
||||
process.exit(0);
|
||||
}, 1000);
|
||||
});
|
||||
Reference in New Issue
Block a user