fix: uv loop polling when render process reuse enabled (#25869)

This commit is contained in:
Shelley Vohr 2020-10-13 09:19:44 -07:00 committed by GitHub
parent d57cd09f14
commit e8166db9d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 3 deletions

View file

@ -4286,6 +4286,30 @@ describe('BrowserWindow module', () => {
});
});
describe('reloading with allowRendererProcessReuse enabled', () => {
it('does not cause Node.js module API hangs after reload', (done) => {
const w = new BrowserWindow({
show: false,
webPreferences: {
nodeIntegration: true
}
});
let count = 0;
ipcMain.on('async-node-api-done', () => {
if (count === 3) {
ipcMain.removeAllListeners('async-node-api-done');
done();
} else {
count++;
w.reload();
}
});
w.loadFile(path.join(fixtures, 'pages', 'send-after-node.html'));
});
});
describe('window.webContents.focus()', () => {
afterEach(closeAllWindows);
it('focuses window', async () => {