Skip to content

Commit

Permalink
test: add window.close() test
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Feb 28, 2023
1 parent 7a1f489 commit c915e50
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/api-browser-view-spec.ts
Expand Up @@ -354,6 +354,15 @@ describe('BrowserView module', () => {
view.webContents.close();
await once(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 once(view.webContents, 'destroyed');
});
});

describe('window.open()', () => {
Expand Down

0 comments on commit c915e50

Please sign in to comment.