From: Kevin Sawicki Date: Tue, 29 Nov 2016 20:13:33 +0000 (-0800) Subject: Close window in an afterEach X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d20e664ea8c7580e933e41493e7026cec57dc422;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git Close window in an afterEach --- diff --git a/spec/asar-spec.js b/spec/asar-spec.js index 5399cde..9d485ed 100644 --- a/spec/asar-spec.js +++ b/spec/asar-spec.js @@ -792,6 +792,11 @@ describe('asar package', function () { describe('asar protocol', function () { var url = require('url') + var w = null + + afterEach(function () { + return closeWindow(w).then(function () { w = null }) + }) it('can request a file in package', function (done) { var p = path.resolve(fixtures, 'asar', 'a.asar', 'file1') @@ -839,10 +844,9 @@ describe('asar package', function () { it('sets __dirname correctly', function (done) { after(function () { ipcMain.removeAllListeners('dirname') - return closeWindow(w).then(function () { w = null }) }) - var w = new BrowserWindow({ + w = new BrowserWindow({ show: false, width: 400, height: 400 @@ -863,10 +867,9 @@ describe('asar package', function () { it('loads script tag in html', function (done) { after(function () { ipcMain.removeAllListeners('ping') - return closeWindow(w).then(function () { w = null }) }) - var w = new BrowserWindow({ + w = new BrowserWindow({ show: false, width: 400, height: 400 @@ -889,10 +892,9 @@ describe('asar package', function () { after(function () { ipcMain.removeAllListeners('asar-video') - return closeWindow(w).then(function () { w = null }) }) - var w = new BrowserWindow({ + w = new BrowserWindow({ show: false, width: 400, height: 400