fix: handle BrowserView reparenting (#27000)
This commit is contained in:
parent
6307b52dc5
commit
3286b5fa46
2 changed files with 36 additions and 2 deletions
|
@ -158,6 +158,27 @@ describe('BrowserView module', () => {
|
|||
w.addBrowserView(view1);
|
||||
}).to.not.throw();
|
||||
});
|
||||
|
||||
it('can handle BrowserView reparenting', async () => {
|
||||
view = new BrowserView();
|
||||
|
||||
w.addBrowserView(view);
|
||||
view.webContents.loadURL('about:blank');
|
||||
await emittedOnce(view.webContents, 'did-finish-load');
|
||||
|
||||
const w2 = new BrowserWindow({ show: false });
|
||||
w2.addBrowserView(view);
|
||||
|
||||
w.close();
|
||||
|
||||
view.webContents.loadURL(`file://${fixtures}/pages/blank.html`);
|
||||
await emittedOnce(view.webContents, 'did-finish-load');
|
||||
|
||||
// Clean up - the afterEach hook assumes the webContents on w is still alive.
|
||||
w = new BrowserWindow({ show: false });
|
||||
w2.close();
|
||||
w2.destroy();
|
||||
});
|
||||
});
|
||||
|
||||
describe('BrowserWindow.removeBrowserView()', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue