From 8f8a400ed5796cf36cde147192c5bcd997e52e98 Mon Sep 17 00:00:00 2001 From: Alexandra Borovova Date: Mon, 13 Mar 2023 16:20:18 +0000 Subject: [PATCH] Bug 1783086 - [marionette] Rename `printBackground` to `background` for WebDriver compatibility. r=webdriver-reviewers,whimboo Differential Revision: https://phabricator.services.mozilla.com/D171693 --- remote/marionette/driver.sys.mjs | 11 ++++++----- remote/shared/PDF.sys.mjs | 4 ---- .../wptrunner/executors/executormarionette.py | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/remote/marionette/driver.sys.mjs b/remote/marionette/driver.sys.mjs index 6195a4e42410..1f90e40faca8 100644 --- a/remote/marionette/driver.sys.mjs +++ b/remote/marionette/driver.sys.mjs @@ -3010,6 +3010,9 @@ GeckoDriver.prototype.teardownReftest = function() { /** * Print page as PDF. * + * @param {boolean=} background + * Whether or not to print background colors and images. + * Defaults to false, which prints without background graphics. * @param {boolean=} landscape * Paper orientation. Defaults to false. * @param {number=} margin.bottom @@ -3027,14 +3030,12 @@ GeckoDriver.prototype.teardownReftest = function() { * Paper height in cm. Defaults to US letter height (27.94cm / 11 inches) * @param {number=} page.width * Paper width in cm. Defaults to US letter width (21.59cm / 8.5 inches) + * @param {number=} scale + * Scale of the webpage rendering. Defaults to 1.0. * @param {boolean=} shrinkToFit * Whether or not to override page size as defined by CSS. * Defaults to true, in which case the content will be scaled * to fit the paper size. - * @param {boolean=} printBackground - * Print background graphics. Defaults to false. - * @param {number=} scale - * Scale of the webpage rendering. Defaults to 1. * * @return {string} * Base64 encoded PDF representing printed document @@ -3076,7 +3077,7 @@ GeckoDriver.prototype.print = async function(cmd) { )(settings.scale); lazy.assert.boolean(settings.shrinkToFit); lazy.assert.boolean(settings.landscape); - lazy.assert.boolean(settings.printBackground); + lazy.assert.boolean(settings.background); lazy.assert.array(settings.pageRanges); const browsingContext = this.curBrowser.tab.linkedBrowser.browsingContext; diff --git a/remote/shared/PDF.sys.mjs b/remote/shared/PDF.sys.mjs index a07a0e7b42c3..8508137ad26c 100644 --- a/remote/shared/PDF.sys.mjs +++ b/remote/shared/PDF.sys.mjs @@ -42,8 +42,6 @@ print.addDefaultSettings = function(settings) { orientation = "portrait", page = {}, pageRanges = [], - // TODO: Bug 1783086. Remove when marionette supports background argument. - printBackground = false, scale = 1.0, shrinkToFit = true, } = settings; @@ -83,8 +81,6 @@ print.addDefaultSettings = function(settings) { orientation, page, pageRanges, - // TODO: Bug 1783086. Remove when marionette supports background argument. - printBackground, scale, shrinkToFit, }; diff --git a/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py b/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py index f1faa9c25d26..c2148a8fe1ac 100644 --- a/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py +++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py @@ -657,7 +657,7 @@ class MarionettePrintProtocolPart(PrintProtocolPart): "bottom": margin, }, "shrinkToFit": False, - "printBackground": True, + "background": True, } return self.marionette._send_message("WebDriver:Print", body, key="value")