fix(frames): networkidle for iframes with quirky urls (#13767)

This commit is contained in:
Dmitry Gozman 2022-04-26 17:13:45 +01:00 committed by GitHub
parent 37bee74ae5
commit c0f0979055
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 0 deletions

View File

@ -468,6 +468,7 @@ export class Frame extends SdkObject {
this._firedLifecycleEvents.add('commit');
this._subtreeLifecycleEvents.add('commit');
this._startNetworkIdleTimer();
}
isDetached(): boolean {

View File

@ -180,3 +180,32 @@ it('should work for frame', async ({ page, server }) => {
request.continue();
await loadPromise;
});
it('should work with javascript: iframe', async ({ page, server, browserName }) => {
it.fixme(browserName === 'firefox', 'no load event');
await page.goto(server.EMPTY_PAGE);
await page.setContent(`<iframe src="javascript:false"></iframe>`, { waitUntil: 'commit' });
await page.waitForLoadState('domcontentloaded');
await page.waitForLoadState('load');
await page.waitForLoadState('networkidle');
});
it('should work with broken data-url iframe', async ({ page, server }) => {
await page.goto(server.EMPTY_PAGE);
await page.setContent(`<iframe src="data:text/html"></iframe>`, { waitUntil: 'commit' });
await page.waitForLoadState('domcontentloaded');
await page.waitForLoadState('load');
await page.waitForLoadState('networkidle');
});
it('should work with broken blob-url iframe', async ({ page, server, browserName }) => {
it.fixme(browserName === 'chromium', 'no load event');
it.fixme(browserName === 'firefox', 'no load event');
await page.goto(server.EMPTY_PAGE);
await page.setContent(`<iframe src="blob:"></iframe>`, { waitUntil: 'commit' });
await page.waitForLoadState('domcontentloaded');
await page.waitForLoadState('load');
await page.waitForLoadState('networkidle');
});