|
@@ -1400,6 +1400,19 @@ describe('webContents module', () => {
|
|
|
const data = await w.webContents.printToPDF({})
|
|
|
expect(data).to.be.an.instanceof(Buffer).that.is.not.empty()
|
|
|
})
|
|
|
+
|
|
|
+ it('does not crash when called multiple times', async () => {
|
|
|
+ const w = new BrowserWindow({ show: false, webPreferences: { sandbox: true } })
|
|
|
+ await w.loadURL('data:text/html,<h1>Hello, World!</h1>')
|
|
|
+ const promises = []
|
|
|
+ for (let i = 0; i < 2; i++) {
|
|
|
+ promises.push(w.webContents.printToPDF({}))
|
|
|
+ }
|
|
|
+ const results = await Promise.all(promises)
|
|
|
+ for (const data of results) {
|
|
|
+ expect(data).to.be.an.instanceof(Buffer).that.is.not.empty()
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
|
|
|
describe('PictureInPicture video', () => {
|