Skip to content

Commit

Permalink
test: add window.close() test
Browse files Browse the repository at this point in the history
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
  • Loading branch information
trop[bot] and codebytere committed Mar 1, 2023
1 parent 1854e8b commit a5f64fc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion spec/api-browser-view-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,16 @@ describe('BrowserView module', () => {
await view.webContents.loadFile(path.join(fixtures, 'pages', 'a.html'));

view.webContents.close();
await once(view.webContents, 'destroyed');
await emittedOnce(view.webContents, 'destroyed');
});

it('emits the destroyed event when window.close() is called', async () => {
view = new BrowserView();
w.setBrowserView(view);
await view.webContents.loadFile(path.join(fixtures, 'pages', 'a.html'));

view.webContents.executeJavaScript('window.close()');
await emittedOnce(view.webContents, 'destroyed');
});
});

Expand Down

0 comments on commit a5f64fc

Please sign in to comment.