Add failing spec for app.exit with >2 windows
This commit is contained in:
parent
a30cf30e93
commit
bfb9388191
3 changed files with 33 additions and 0 deletions
|
@ -137,6 +137,16 @@ describe('app module', function () {
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('closes all windows', function (done) {
|
||||||
|
var appPath = path.join(__dirname, 'fixtures', 'api', 'exit-closes-all-windows-app')
|
||||||
|
var electronPath = remote.getGlobal('process').execPath
|
||||||
|
appProcess = ChildProcess.spawn(electronPath, [appPath])
|
||||||
|
appProcess.on('close', function (code) {
|
||||||
|
assert.equal(code, 123)
|
||||||
|
done()
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('app.relaunch', function () {
|
describe('app.relaunch', function () {
|
||||||
|
|
19
spec/fixtures/api/exit-closes-all-windows-app/main.js
vendored
Normal file
19
spec/fixtures/api/exit-closes-all-windows-app/main.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
const {app, BrowserWindow} = require('electron')
|
||||||
|
|
||||||
|
const windows = []
|
||||||
|
|
||||||
|
function createWindow (id) {
|
||||||
|
const window = new BrowserWindow({show: false})
|
||||||
|
window.loadURL(`data:,window${id}`)
|
||||||
|
windows.push(window)
|
||||||
|
}
|
||||||
|
|
||||||
|
app.once('ready', () => {
|
||||||
|
for (let i = 1; i <= 5; i++) {
|
||||||
|
createWindow(i)
|
||||||
|
}
|
||||||
|
|
||||||
|
setImmediate(function () {
|
||||||
|
app.exit(123)
|
||||||
|
})
|
||||||
|
})
|
4
spec/fixtures/api/exit-closes-all-windows-app/package.json
vendored
Normal file
4
spec/fixtures/api/exit-closes-all-windows-app/package.json
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"name": "electron-exit-closes-all-windows",
|
||||||
|
"main": "main.js"
|
||||||
|
}
|
Loading…
Reference in a new issue