refactor: printToPDF should be headless (#33654)

This commit is contained in:
Shelley Vohr 2022-05-31 08:21:25 +02:00 committed by GitHub
parent 0d69067dee
commit 93b39b92b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 648 additions and 414 deletions

View file

@ -1110,14 +1110,16 @@ describe('<webview> tag', function () {
ifdescribe(features.isPrintingEnabled())('<webview>.printToPDF()', () => {
it('rejects on incorrectly typed parameters', async () => {
const badTypes = {
marginsType: 'terrible',
scaleFactor: 'not-a-number',
landscape: [],
pageRanges: { oops: 'im-not-the-right-key' },
headerFooter: '123',
printSelectionOnly: 1,
displayHeaderFooter: '123',
printBackground: 2,
pageSize: 'IAmAPageSize'
scale: 'not-a-number',
pageSize: 'IAmAPageSize',
margins: 'terrible',
pageRanges: { oops: 'im-not-the-right-key' },
headerTemplate: [1, 2, 3],
footerTemplate: [4, 5, 6],
preferCSSPageSize: 'no'
};
// These will hard crash in Chromium unless we type-check