Add initial power save blocker spec
This commit is contained in:
parent
ab0d726594
commit
39e1541a7e
1 changed files with 13 additions and 0 deletions
13
spec/api-power-save-blocker-spec.js
Normal file
13
spec/api-power-save-blocker-spec.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
const {powerSaveBlocker} = require('electron').remote
|
||||
const assert = require('assert')
|
||||
|
||||
describe('powerSaveBlocker module', () => {
|
||||
it('can be started and stopped', () => {
|
||||
assert.equal(powerSaveBlocker.isStarted(-1), false)
|
||||
const id = powerSaveBlocker.start('prevent-app-suspension')
|
||||
assert.ok(id != null)
|
||||
assert.equal(powerSaveBlocker.isStarted(id), true)
|
||||
powerSaveBlocker.stop(id)
|
||||
assert.equal(powerSaveBlocker.isStarted(id), false)
|
||||
})
|
||||
})
|
Loading…
Reference in a new issue