|
@@ -151,7 +151,7 @@ describe('BrowserView module', () => {
|
|
|
w.addBrowserView(view);
|
|
|
});
|
|
|
|
|
|
- it('does not crash if the BrowserView webContents are destroyed prior to window removal', () => {
|
|
|
+ it('does not crash if the BrowserView webContents are destroyed prior to window addition', () => {
|
|
|
expect(() => {
|
|
|
const view1 = new BrowserView();
|
|
|
(view1.webContents as any).destroy();
|
|
@@ -159,6 +159,15 @@ describe('BrowserView module', () => {
|
|
|
}).to.not.throw();
|
|
|
});
|
|
|
|
|
|
+ it('does not crash if the webContents is destroyed after a URL is loaded', () => {
|
|
|
+ view = new BrowserView();
|
|
|
+ expect(async () => {
|
|
|
+ view.setBounds({ x: 0, y: 0, width: 400, height: 300 });
|
|
|
+ await view.webContents.loadURL('data:text/html,hello there');
|
|
|
+ view.webContents.destroy();
|
|
|
+ }).to.not.throw();
|
|
|
+ });
|
|
|
+
|
|
|
it('can handle BrowserView reparenting', async () => {
|
|
|
view = new BrowserView();
|
|
|
|