зеркало из https://github.com/electron/electron.git
test: fixup assertNotWindows (#41045)
* chore: fixup assertNotWindows * remove logging
This commit is contained in:
Родитель
7e6fb97a2f
Коммит
3dafb318a8
|
@ -29,13 +29,19 @@ export const closeWindow = async (
|
|||
await ensureWindowIsClosed(window);
|
||||
|
||||
if (assertNotWindows) {
|
||||
const windows = BaseWindow.getAllWindows();
|
||||
try {
|
||||
expect(windows).to.have.lengthOf(0);
|
||||
} finally {
|
||||
for (const win of windows) {
|
||||
await ensureWindowIsClosed(win);
|
||||
}
|
||||
let windows = BaseWindow.getAllWindows();
|
||||
if (windows.length > 0) {
|
||||
setTimeout(async () => {
|
||||
// Wait until next tick to assert that all windows have been closed.
|
||||
windows = BaseWindow.getAllWindows();
|
||||
try {
|
||||
expect(windows).to.have.lengthOf(0);
|
||||
} finally {
|
||||
for (const win of windows) {
|
||||
await ensureWindowIsClosed(win);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче