Skip to content

Commit

Permalink
test: fix for flaky renderer crash test (#34452)
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelmaddock committed Jun 6, 2022
1 parent e56f626 commit 882fa36
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec-main/api-web-frame-main-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,9 @@ describe('webFrameMain module', () => {
// Keep reference to mainFrame alive throughout crash and recovery.
const { mainFrame } = w.webContents;
await w.webContents.loadURL(server.url);
const crashEvent = emittedOnce(w.webContents, 'render-process-gone');
w.webContents.forcefullyCrashRenderer();
await crashEvent;
await w.webContents.loadURL(server.url);
// Log just to keep mainFrame in scope.
console.log('mainFrame.url', mainFrame.url);
Expand All @@ -244,7 +246,9 @@ describe('webFrameMain module', () => {
// Keep reference to mainFrame alive throughout crash and recovery.
const { mainFrame } = w.webContents;
await w.webContents.loadURL(server.url);
const crashEvent = emittedOnce(w.webContents, 'render-process-gone');
w.webContents.forcefullyCrashRenderer();
await crashEvent;
// A short wait seems to be required to reproduce the crash.
await new Promise(resolve => setTimeout(resolve, 100));
await w.webContents.loadURL(crossOriginUrl);
Expand Down

0 comments on commit 882fa36

Please sign in to comment.