diff --git a/spec/lib/window-helpers.ts b/spec/lib/window-helpers.ts index e3dc62b6a2..df0c350668 100644 --- a/spec/lib/window-helpers.ts +++ b/spec/lib/window-helpers.ts @@ -60,11 +60,14 @@ export async function closeAllWindows (assertNotWindows = false) { export async function cleanupWebContents () { let webContentsDestroyed = 0; const existingWCS = webContents.getAllWebContents(); + webContentsDestroyed = existingWCS.length; + /* for (const contents of existingWCS) { - /*const isDestroyed = once(contents, 'destroyed'); + const isDestroyed = once(contents, 'destroyed'); contents.destroy(); - await isDestroyed;*/ + await isDestroyed; webContentsDestroyed++; } + */ return webContentsDestroyed; }