Assert PID is 0 with no URL

This commit is contained in:
Kevin Sawicki 2017-05-15 13:34:30 -07:00
parent 350528707b
commit 0ae5f7e623

View file

@ -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')
})