fix(page): Page.goto should properly handle historyAPI in beforeunload (#3198)

Fixes #2764.
This commit is contained in:
Andrey Lushnikov
2018-09-05 22:59:29 +01:00
committed by GitHub
parent 28d92116b7
commit d54c7edeae
3 changed files with 50 additions and 29 deletions

View File

@@ -552,7 +552,7 @@ module.exports.addTests = function({testRunner, expect, headless}) {
expect(response.status()).toBe(200);
expect(response.securityDetails()).toBe(null);
});
xit('should work when page calls history API in beforeunload', async({page, server}) => {
it('should work when page calls history API in beforeunload', async({page, server}) => {
await page.goto(server.EMPTY_PAGE);
await page.evaluate(() => {
window.addEventListener('beforeunload', () => history.replaceState(null, 'initial', window.location.href), false);