test: attempt at fixing flaky takeHeapSnapshotTest (#15881)

ref #15095
This commit is contained in:
trop[bot]
2018-11-29 10:57:48 -06:00
committed by Charles Kerr
parent 53e4cdf30a
commit 8b37e62717

View File

@@ -878,8 +878,9 @@ describe('webContents module', () => {
}
})
const p = emittedOnce(w.webContents, 'did-finish-load')
w.loadURL('about:blank')
await emittedOnce(w.webContents, 'did-finish-load')
await p
const filePath = path.join(remote.app.getPath('temp'), 'test.heapsnapshot')
@@ -909,8 +910,9 @@ describe('webContents module', () => {
}
})
const p = emittedOnce(w.webContents, 'did-finish-load')
w.loadURL('about:blank')
await emittedOnce(w.webContents, 'did-finish-load')
await p
const promise = w.webContents.takeHeapSnapshot('')
return expect(promise).to.be.eventually.rejectedWith(Error, 'takeHeapSnapshot failed')