closeWindow in an afterEach block
This commit is contained in:
Родитель
d20e664ea8
Коммит
cc2936cfdf
|
@ -6,6 +6,11 @@ const {BrowserWindow, protocol, ipcMain} = remote
|
|||
|
||||
describe('webFrame module', function () {
|
||||
var fixtures = path.resolve(__dirname, 'fixtures')
|
||||
var w = null
|
||||
|
||||
afterEach(function () {
|
||||
return closeWindow(w).then(function () { w = null })
|
||||
})
|
||||
|
||||
describe('webFrame.registerURLSchemeAsPrivileged', function () {
|
||||
it('supports fetch api by default', function (done) {
|
||||
|
@ -96,17 +101,14 @@ describe('webFrame module', function () {
|
|||
runNumber++
|
||||
|
||||
const url = standardScheme + '://fake-host'
|
||||
var w = new BrowserWindow({show: false})
|
||||
w = new BrowserWindow({show: false})
|
||||
after(function (done) {
|
||||
protocol.unregisterProtocol(corsScheme, function () {
|
||||
protocol.unregisterProtocol(standardScheme, function () {
|
||||
closeWindow(w).then(function () {
|
||||
w = null
|
||||
done()
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
const handler = function (request, callback) {
|
||||
callback({data: content, mimeType: 'text/html'})
|
||||
|
|
Загрузка…
Ссылка в новой задаче