Assert PID is 0 with no URL
This commit is contained in:
parent
350528707b
commit
0ae5f7e623
1 changed files with 3 additions and 7 deletions
|
@ -326,14 +326,10 @@ describe('webContents module', function () {
|
||||||
|
|
||||||
describe('getOSProcessId()', function () {
|
describe('getOSProcessId()', function () {
|
||||||
it('returns a valid procress id', function () {
|
it('returns a valid procress id', function () {
|
||||||
// load URL otherwise getOSProcessId() returns 0
|
assert.strictEqual(w.webContents.getOSProcessId(), 0)
|
||||||
w.loadURL('file://' + path.join(__dirname, 'fixtures', 'pages', 'focus-web-contents.html'))
|
|
||||||
|
|
||||||
const specWebContents = w.webContents
|
w.loadURL('about:blank')
|
||||||
let pid = null
|
const pid = w.webContents.getOSProcessId()
|
||||||
assert.doesNotThrow(function () {
|
|
||||||
pid = specWebContents.getOSProcessId()
|
|
||||||
})
|
|
||||||
assert(typeof pid === 'number', 'is a number')
|
assert(typeof pid === 'number', 'is a number')
|
||||||
assert(pid > 0, 'superior to 0')
|
assert(pid > 0, 'superior to 0')
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue