fix: printToPDF failing to generate PDF (#21783)

This commit is contained in:
Shelley Vohr 2020-01-15 21:05:36 -08:00 committed by GitHub
parent b9eb68c0b4
commit 1e99907acc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 4 deletions

View file

@ -1413,17 +1413,16 @@ describe('webContents module', () => {
})
})
// TODO(deepak1556): Fix and enable after upgrade.
ifdescribe(features.isPrintingEnabled())('printToPDF()', () => {
afterEach(closeAllWindows)
it.skip('can print to PDF', async () => {
it('can print to PDF', async () => {
const w = new BrowserWindow({ show: false, webPreferences: { sandbox: true } })
await w.loadURL('data:text/html,<h1>Hello, World!</h1>')
const data = await w.webContents.printToPDF({})
expect(data).to.be.an.instanceof(Buffer).that.is.not.empty()
})
it.skip('does not crash when called multiple times', async () => {
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 = []