test: ctrl+click during provisional load (#11710)

This commit is contained in:
Yury Semikhatsky 2022-01-28 11:47:14 -08:00 committed by GitHub
parent ac36608a69
commit 312ab57f02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -184,3 +184,17 @@ it('should work with Ctrl-clicking', async ({ browser, server, isMac, browserNam
expect(await popup.opener()).toBe(null);
await context.close();
});
it('should not hang on ctrl-click during provisional load', async ({ context, page, server, isMac, browserName }) => {
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/11595' });
it.skip(browserName === 'chromium', 'Chromium does not dispatch renderer messages while navigation is provisional.');
await page.goto(server.EMPTY_PAGE);
await page.setContent('<a href="/one-style.html">yo</a>');
server.setRoute('/slow.html', () => {});
const [popup] = await Promise.all([
context.waitForEvent('page'),
server.waitForRequest('/slow.html').then(() => page.click('a', { modifiers: [ isMac ? 'Meta' : 'Control'] })),
page.evaluate(url => setTimeout(() => location.href = url, 0), server.CROSS_PROCESS_PREFIX + '/slow.html'),
]);
expect(popup).toBeTruthy();
});