electron/spec/api-power-save-blocker-spec.js

14 строки
470 B
JavaScript
Исходник Обычный вид История

2016-08-10 01:05:56 +03:00
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)
})
})