closeWindow in an afterEach block
This commit is contained in:
parent
d20e664ea8
commit
cc2936cfdf
1 changed files with 7 additions and 5 deletions
|
@ -6,6 +6,11 @@ const {BrowserWindow, protocol, ipcMain} = remote
|
||||||
|
|
||||||
describe('webFrame module', function () {
|
describe('webFrame module', function () {
|
||||||
var fixtures = path.resolve(__dirname, 'fixtures')
|
var fixtures = path.resolve(__dirname, 'fixtures')
|
||||||
|
var w = null
|
||||||
|
|
||||||
|
afterEach(function () {
|
||||||
|
return closeWindow(w).then(function () { w = null })
|
||||||
|
})
|
||||||
|
|
||||||
describe('webFrame.registerURLSchemeAsPrivileged', function () {
|
describe('webFrame.registerURLSchemeAsPrivileged', function () {
|
||||||
it('supports fetch api by default', function (done) {
|
it('supports fetch api by default', function (done) {
|
||||||
|
@ -96,17 +101,14 @@ describe('webFrame module', function () {
|
||||||
runNumber++
|
runNumber++
|
||||||
|
|
||||||
const url = standardScheme + '://fake-host'
|
const url = standardScheme + '://fake-host'
|
||||||
var w = new BrowserWindow({show: false})
|
w = new BrowserWindow({show: false})
|
||||||
after(function (done) {
|
after(function (done) {
|
||||||
protocol.unregisterProtocol(corsScheme, function () {
|
protocol.unregisterProtocol(corsScheme, function () {
|
||||||
protocol.unregisterProtocol(standardScheme, function () {
|
protocol.unregisterProtocol(standardScheme, function () {
|
||||||
closeWindow(w).then(function () {
|
|
||||||
w = null
|
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
|
|
||||||
const handler = function (request, callback) {
|
const handler = function (request, callback) {
|
||||||
callback({data: content, mimeType: 'text/html'})
|
callback({data: content, mimeType: 'text/html'})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue