api-power-save-blocker-spec.js 470 B

1234567891011121314
  1. const {powerSaveBlocker} = require('electron').remote
  2. const assert = require('assert')
  3. describe('powerSaveBlocker module', () => {
  4. it('can be started and stopped', () => {
  5. assert.equal(powerSaveBlocker.isStarted(-1), false)
  6. const id = powerSaveBlocker.start('prevent-app-suspension')
  7. assert.ok(id != null)
  8. assert.equal(powerSaveBlocker.isStarted(id), true)
  9. powerSaveBlocker.stop(id)
  10. assert.equal(powerSaveBlocker.isStarted(id), false)
  11. })
  12. })