fix: crash on invalid zoomFactor (#22673)
This commit is contained in:
parent
9c5874306d
commit
a4c4c86b9d
6 changed files with 37 additions and 5 deletions
|
@ -846,6 +846,19 @@ describe('webContents module', () => {
|
|||
|
||||
afterEach(closeAllWindows)
|
||||
|
||||
it('throws on an invalid zoomFactor', async () => {
|
||||
const w = new BrowserWindow({ show: false })
|
||||
await w.loadURL('about:blank')
|
||||
|
||||
expect(() => {
|
||||
w.webContents.setZoomFactor(0.0)
|
||||
}).to.throw(/'zoomFactor' must be a double greater than 0.0/)
|
||||
|
||||
expect(() => {
|
||||
w.webContents.setZoomFactor(-2.0)
|
||||
}).to.throw(/'zoomFactor' must be a double greater than 0.0/)
|
||||
})
|
||||
|
||||
it('can set the correct zoom level (functions)', async () => {
|
||||
const w = new BrowserWindow({ show: false })
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue