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

This commit is contained in:
Jeremy Apthorp 2020-05-21 08:46:17 -07:00 коммит произвёл GitHub
Родитель 3137d5f011
Коммит 5bdf97e7ae
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 14 добавлений и 0 удалений

Просмотреть файл

@ -32,6 +32,20 @@ describe('<webview> tag', function () {
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 () => {
const w = new BrowserWindow({
show: false,