From 0ae5f7e62354e2758dbbe2614fefa808f31a6cc1 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 15 May 2017 13:34:30 -0700 Subject: [PATCH] Assert PID is 0 with no URL --- spec/api-web-contents-spec.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/spec/api-web-contents-spec.js b/spec/api-web-contents-spec.js index 92cbd2bfaf51..186a6458b172 100644 --- a/spec/api-web-contents-spec.js +++ b/spec/api-web-contents-spec.js @@ -326,14 +326,10 @@ 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')) + assert.strictEqual(w.webContents.getOSProcessId(), 0) - const specWebContents = w.webContents - let pid = null - assert.doesNotThrow(function () { - pid = specWebContents.getOSProcessId() - }) + w.loadURL('about:blank') + const pid = w.webContents.getOSProcessId() assert(typeof pid === 'number', 'is a number') assert(pid > 0, 'superior to 0') })