Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: renderer crash on setImmediate (#26748)
- Loading branch information
1 parent
415c1f9
commit 738740f
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
spec-main/fixtures/crash-cases/setimmediate-renderer-crash/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const { app, BrowserWindow } = require('electron'); | ||
const path = require('path'); | ||
|
||
app.whenReady().then(() => { | ||
const win = new BrowserWindow({ | ||
show: false, | ||
webPreferences: { | ||
nodeIntegration: true, | ||
preload: path.resolve(__dirname, 'preload.js') | ||
} | ||
}); | ||
|
||
win.loadURL('about:blank'); | ||
|
||
win.webContents.on('render-process-gone', () => { | ||
process.exit(1); | ||
}); | ||
|
||
win.webContents.on('did-finish-load', () => { | ||
setTimeout(() => app.quit()); | ||
}); | ||
}); |
3 changes: 3 additions & 0 deletions
3
spec-main/fixtures/crash-cases/setimmediate-renderer-crash/preload.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
setImmediate(() => { | ||
throw new Error('oh no'); | ||
}); |