naive fix

This commit is contained in:
Simon Knott 2024-07-31 13:50:37 +02:00
parent 3a02389cb2
commit 9b6ce75f5f
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC
2 changed files with 3 additions and 1 deletions

View file

@ -495,6 +495,8 @@ export class Frame extends SdkObject {
this._currentDocument = { documentId: undefined, request: undefined };
this.selectors = new FrameSelectors(this);
this._page.on(Page.Events.Crash, () => this._onDetached());
this._contextData.set('main', { contextPromise: new ManualPromise(), context: null });
this._contextData.set('utility', { contextPromise: new ManualPromise(), context: null });
this._setContext('main', null);

View file

@ -85,5 +85,5 @@ test('should not hang when page crashed', async ({ page }) => {
const expectPromise = expect(page.getByText('child')).toBeVisible();
await page.goto('chrome://crash').catch(e => {});
await expectPromise;
await expect(expectPromise).rejects.toThrowError();
});