feat: expose setBackgroundThrottling api (#15104)
This commit is contained in:
parent
10db2bce4e
commit
37f2113032
5 changed files with 71 additions and 0 deletions
|
@ -905,4 +905,31 @@ describe('webContents module', () => {
|
|||
return expect(promise).to.be.eventually.rejectedWith(Error, 'takeHeapSnapshot failed')
|
||||
})
|
||||
})
|
||||
|
||||
describe('setBackgroundThrottling()', () => {
|
||||
it('does not crash when allowing', (done) => {
|
||||
w.webContents.setBackgroundThrottling(true)
|
||||
done()
|
||||
})
|
||||
|
||||
it('does not crash when disallowing', (done) => {
|
||||
w.destroy()
|
||||
w = new BrowserWindow({
|
||||
show: false,
|
||||
width: 400,
|
||||
height: 400,
|
||||
webPreferences: {
|
||||
backgroundThrottling: true
|
||||
}
|
||||
})
|
||||
|
||||
w.webContents.setBackgroundThrottling(false)
|
||||
done()
|
||||
})
|
||||
|
||||
it('does not crash when called via BrowserWindow', (done) => {
|
||||
w.setBackgroundThrottling(true)
|
||||
done()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue