test: make sure headful browser closes with beforeuload page (#3751)

This was fixed upstream at https://crrev.com/618425

Fixes #3673
This commit is contained in:
Andrey Lushnikov
2019-01-10 14:05:43 -08:00
committed by GitHub
parent 4c48b77503
commit 16fc28bf06

View File

@@ -121,6 +121,15 @@ module.exports.addTests = function({testRunner, expect, defaultBrowserOptions})
]);
await browser.close();
});
it('should close browser with beforeunload page', async({server}) => {
const browser = await puppeteer.launch(headfulOptions);
const page = await browser.newPage();
await page.goto(server.PREFIX + '/beforeunload.html');
// We have to interact with a page so that 'beforeunload' handlers
// fire.
await page.click('body');
await browser.close();
});
});
};