diff --git a/spec/webview-spec.js b/spec/webview-spec.js index 2c0b8098ce..4fb9694b1b 100644 --- a/spec/webview-spec.js +++ b/spec/webview-spec.js @@ -3,6 +3,7 @@ const path = require('path') const http = require('http') const url = require('url') const {app, session, getGuestWebContents, ipcMain, BrowserWindow} = require('electron').remote +const {closeWindow} = require('./window-helpers') describe(' tag', function () { this.timeout(20000) @@ -21,10 +22,7 @@ describe(' tag', function () { document.body.appendChild(webview) } webview.remove() - if (w) { - w.destroy() - w = null - } + return closeWindow(w).then(function () { w = null }) }) it('works without script tag in page', function (done) {