test: hide child windows in webview spec (#23682)

This commit is contained in:
Jeremy Apthorp 2020-05-21 08:46:17 -07:00 committed by GitHub
parent 3137d5f011
commit 5bdf97e7ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,6 +32,20 @@ describe('<webview> tag', function () {
afterEach(closeAllWindows); afterEach(closeAllWindows);
function hideChildWindows (e: any, wc: WebContents) {
wc.on('new-window', (event, url, frameName, disposition, options) => {
options.show = false;
});
}
before(() => {
app.on('web-contents-created', hideChildWindows);
});
after(() => {
app.off('web-contents-created', hideChildWindows);
});
it('works without script tag in page', async () => { it('works without script tag in page', async () => {
const w = new BrowserWindow({ const w = new BrowserWindow({
show: false, show: false,