spec: Add test case for app.makeSingleInstance
This commit is contained in:
parent
b7119b5756
commit
b4075bed87
3 changed files with 40 additions and 0 deletions
13
spec/fixtures/api/singleton/main.js
vendored
Normal file
13
spec/fixtures/api/singleton/main.js
vendored
Normal 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)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue