From 39e1541a7e5c20dfbd7f98843b789ca055186a78 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 9 Aug 2016 15:05:56 -0700 Subject: [PATCH] Add initial power save blocker spec --- spec/api-power-save-blocker-spec.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 spec/api-power-save-blocker-spec.js diff --git a/spec/api-power-save-blocker-spec.js b/spec/api-power-save-blocker-spec.js new file mode 100644 index 000000000000..be97bcb301a6 --- /dev/null +++ b/spec/api-power-save-blocker-spec.js @@ -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) + }) +})