chore: add helper to wait for a window to load in a remote-safe way (#16837)
This commit is contained in:
parent
1632c4b837
commit
833daaa2b2
2 changed files with 10 additions and 3 deletions
|
@ -17,3 +17,10 @@ exports.closeWindow = async (window = null,
|
|||
expect(BrowserWindow.getAllWindows()).to.have.lengthOf(1)
|
||||
}
|
||||
}
|
||||
|
||||
exports.waitForWebContentsToLoad = async (webContents) => {
|
||||
const didFinishLoadPromise = emittedOnce(webContents, 'did-finish-load')
|
||||
if (webContents.isLoadingMainFrame()) {
|
||||
await didFinishLoadPromise
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue