Assert pid after load finishes
This commit is contained in:
		
					parent
					
						
							
								251a61a151
							
						
					
				
			
			
				commit
				
					
						65ab71c894
					
				
			
		
					 1 changed files with 7 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -325,13 +325,16 @@ describe('webContents module', function () {
 | 
			
		|||
  })
 | 
			
		||||
 | 
			
		||||
  describe('getOSProcessId()', function () {
 | 
			
		||||
    it('returns a valid procress id', function () {
 | 
			
		||||
    it('returns a valid procress id', function (done) {
 | 
			
		||||
      assert.strictEqual(w.webContents.getOSProcessId(), 0)
 | 
			
		||||
 | 
			
		||||
      w.webContents.once('did-finish-load', () => {
 | 
			
		||||
        const pid = w.webContents.getOSProcessId()
 | 
			
		||||
        assert.equal(typeof pid, 'number')
 | 
			
		||||
        assert(pid > 0, `pid ${pid} is not greater than 0`)
 | 
			
		||||
        done()
 | 
			
		||||
      })
 | 
			
		||||
      w.loadURL('about:blank')
 | 
			
		||||
      const pid = w.webContents.getOSProcessId()
 | 
			
		||||
      assert(typeof pid === 'number', 'is a number')
 | 
			
		||||
      assert(pid > 0, 'superior to 0')
 | 
			
		||||
    })
 | 
			
		||||
  })
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue