spec: Add test case for app.makeSingleInstance

This commit is contained in:
Cheng Zhao 2017-09-20 11:58:10 +09:00
parent b7119b5756
commit b4075bed87
3 changed files with 40 additions and 0 deletions

13
spec/fixtures/api/singleton/main.js vendored Normal file
View file

@ -0,0 +1,13 @@
const {app} = require('electron')
process.on('uncaughtException', () => {
app.exit(2)
})
const shouldExit = app.makeSingleInstance(() => {
process.nextTick(() => app.exit(0))
})
if (shouldExit) {
app.exit(1)
}