chore: remove disable_user_gesture... patch (#23066)

This commit is contained in:
Jeremy Apthorp 2020-04-16 15:22:39 -07:00 committed by GitHub
parent e4c82fdf2d
commit 2541d62486
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 125 additions and 93 deletions

View file

@ -54,14 +54,16 @@ describe('webContents module', () => {
it('emits if beforeunload returns false', async () => {
const w = new BrowserWindow({ show: false });
w.loadFile(path.join(__dirname, 'fixtures', 'api', 'close-beforeunload-false.html'));
await w.loadFile(path.join(__dirname, 'fixtures', 'api', 'close-beforeunload-false.html'));
w.webContents.executeJavaScript('run()', true);
await emittedOnce(w.webContents, 'will-prevent-unload');
});
it('supports calling preventDefault on will-prevent-unload events', async () => {
const w = new BrowserWindow({ show: false });
w.webContents.once('will-prevent-unload', event => event.preventDefault());
w.loadFile(path.join(__dirname, 'fixtures', 'api', 'close-beforeunload-false.html'));
await w.loadFile(path.join(__dirname, 'fixtures', 'api', 'close-beforeunload-false.html'));
w.webContents.executeJavaScript('run()', true);
await emittedOnce(w, 'closed');
});
});