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 () {
--- /dev/null
+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)
+ })
+})