Close windows instead of destroying them

This commit is contained in:
Kevin Sawicki 2016-08-03 12:47:53 -07:00
parent cce6be1900
commit 0ebe142b2f
10 changed files with 45 additions and 62 deletions

View file

@ -2,6 +2,7 @@
const assert = require('assert')
const path = require('path')
const {closeWindow} = require('./window-helpers')
const {remote} = require('electron')
const {BrowserWindow, webContents} = remote
@ -13,9 +14,6 @@ describe('webContents module', function () {
let w
beforeEach(function () {
if (w != null) {
w.destroy()
}
w = new BrowserWindow({
show: false,
width: 400,
@ -27,10 +25,7 @@ describe('webContents module', function () {
})
afterEach(function () {
if (w != null) {
w.destroy()
}
w = null
return closeWindow(w).then(function () { w = null })
})
describe('getAllWebContents() API', function () {