Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Oct 13, 2020
1 parent d9d5a25 commit caa5bf9
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions spec-main/api-browser-window-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.webContents.reload();
}
});

w.loadFile(path.join(fixtures, 'pages', 'send-after-node.html'));
});
});

describe('window.webContents.focus()', () => {
afterEach(closeAllWindows);
it('focuses window', async () => {
Expand Down

0 comments on commit caa5bf9

Please sign in to comment.