spec: Fix the event test calling done for multiple times

This commit is contained in:
Cheng Zhao 2017-08-02 15:06:06 +09:00
parent d166d08dd5
commit 28959da2b7

View file

@ -1144,13 +1144,16 @@ describe('BrowserWindow module', function () {
w.loadURL('file://' + path.join(fixtures, 'api', 'sandbox.html?window-events')) w.loadURL('file://' + path.join(fixtures, 'api', 'sandbox.html?window-events'))
}) })
it('works for web contents events', function (done) { it('works for stop events', function (done) {
waitForEvents(w.webContents, [ waitForEvents(w.webContents, [
'did-navigate', 'did-navigate',
'did-fail-load', 'did-fail-load',
'did-stop-loading' 'did-stop-loading'
], done) ], done)
w.loadURL('file://' + path.join(fixtures, 'api', 'sandbox.html?webcontents-stop')) w.loadURL('file://' + path.join(fixtures, 'api', 'sandbox.html?webcontents-stop'))
})
it('works for web contents events', function (done) {
waitForEvents(w.webContents, [ waitForEvents(w.webContents, [
'did-finish-load', 'did-finish-load',
'did-frame-finish-load', 'did-frame-finish-load',