From 2f297b18936a846d7e43f12435554fd474858b68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Lach=C3=A8ze?= Date: Mon, 15 May 2017 19:57:19 +0200 Subject: [PATCH] :white_check_mark: Add simple spec for getOSProcessId() --- spec/api-web-contents-spec.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spec/api-web-contents-spec.js b/spec/api-web-contents-spec.js index f081b3900944..166c752f18ff 100644 --- a/spec/api-web-contents-spec.js +++ b/spec/api-web-contents-spec.js @@ -324,6 +324,22 @@ describe('webContents module', function () { }) }) + describe('getOSProcessId()', function() { + it('returns a valid procress id', function() { + + // load URL otherwise getOSProcessId() returns 0 + w.loadURL('file://' + path.join(__dirname, 'fixtures', 'pages', 'focus-web-contents.html')) + + const specWebContents = w.webContents + let pid = null + assert.doesNotThrow(function () { + pid = specWebContents.getOSProcessId() + }) + assert(typeof pid === 'number', 'is a number') + assert(pid > 0 , 'superior to 0') + }) + }) + describe('zoom api', () => { const zoomScheme = remote.getGlobal('zoomScheme') const hostZoomMap = {