Closed Bug 1604506 Opened 10 months ago Closed 10 months ago

Implement print command in marionette

Categories

(Testing :: Marionette, task)

Version 3
task
Not set
normal

Tracking

(firefox73 fixed)

RESOLVED FIXED
mozilla73
Tracking Status
firefox73 --- fixed

People

(Reporter: jgraham, Assigned: jgraham, NeedInfo)

References

Details

Attachments

(2 files)

This will implement the WebDriver print-to-pdf command in marionette, following the proposed WebDriver spec.

Assignee: nobody → james
Status: NEW → ASSIGNED

Add a WebDriver:Print command to marionette, following the proposed
WebDriver spec at https://github.com/w3c/webdriver/pull/1468
The implementation is largely the same as that added to the
remote agent in Bug 1599994.

Attachment #9116414 - Attachment description: Bug 1604506 - Add print endpoint to marionette, → Bug 1604506 - Add print command to marionette,
Pushed by james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/autoland/rev/29c893010729
Add assert.positiveNumber to marionette, r=marionette-reviewers,whimboo,ato
https://hg.mozilla.org/integration/autoland/rev/531ee079b538
Add print command to marionette, r=marionette-reviewers,whimboo,ato

Backed out 4 changesets (bug 1604506, bug 1602547, bug 1602544) for failing at /printcmd.py and /user_prompts.py

Backout link: https://hg.mozilla.org/integration/autoland/rev/70c7a9fa71304413d9acaa4eabe0df85d87f7522

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&revision=cad798d12930ed716fd860af93deeeddad297019&selectedJob=281838694

Log link: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=281838694&repo=autoland&lineNumber=111493

Log snippet:
[task 2019-12-19T02:33:32.556Z] 02:33:32 INFO - PID 3138 | 1576722812520 webdriver::server DEBUG <- 200 OK {"value":null}
[task 2019-12-19T02:33:32.556Z] 02:33:32 INFO - PID 3138 | 1576722812522 webdriver::server DEBUG -> POST /session/aaeb77b3-abc3-d84d-8598-56859e8f39d4/moz/print {}
[task 2019-12-19T02:33:32.559Z] 02:33:32 INFO - PID 3138 | 1576722812531 Marionette DEBUG 0 -> [0,31,"WebDriver:Print",{"background":false,"margin":{"bottom":1,"left":1,"right":1,"top":1},"orientation":"portrait","page":{"height":27.94,"width":21.59},"pageRanges":[],"scale":1,"shrinkToFit":true}]
[task 2019-12-19T02:33:59.226Z] 02:33:59 INFO - TEST-UNEXPECTED-TIMEOUT | /_mozilla/webdriver/print/printcmd.py | expected OK
[task 2019-12-19T02:33:59.226Z] 02:33:59 INFO - TEST-INFO took 30118ms
[task 2019-12-19T02:33:59.374Z] 02:33:59 INFO - STDOUT: FAILED
[task 2019-12-19T02:33:59.374Z] 02:33:59 INFO - Closing logging queue
[task 2019-12-19T02:33:59.374Z] 02:33:59 INFO - queue closed
[task 2019-12-19T02:33:59.374Z] 02:33:59 INFO - Starting runner
[task 2019-12-19T02:33:59.407Z] 02:33:59 INFO - PID 3146 | 1576722839391 geckodriver DEBUG Listening on 127.0.0.1:58574
[task 2019-12-19T02:33:59.886Z] 02:33:59 INFO - WebDriver HTTP server listening at http://127.0.0.1:58574

Flags: needinfo?(james)

Turns out that kPaperSizeMillimeters resulted in a too-large surface on Mac, so I have a suspicion that it's using inches for the paper size there regardless. Updated the patch to just use Inches always, verified locally we get sensible output and try push at https://treeherder.mozilla.org/#/jobs?repo=try&revision=9b216c2acab8a0fff61635996362c3e183f15409

Flags: needinfo?(james)

(In reply to James Graham [:jgraham] from comment #5)

Turns out that kPaperSizeMillimeters resulted in a too-large surface on Mac, so I have a suspicion that it's using inches for the paper size there regardless. Updated the patch to just use Inches always, verified locally we get sensible output and try push at https://treeherder.mozilla.org/#/jobs?repo=try&revision=9b216c2acab8a0fff61635996362c3e183f15409

Jonathan, do you have any idea why this is happening on Mac? Maybe it's a bug which we could cover with your rewrite of the printing code?

Flags: needinfo?(jwatt)
Pushed by james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/autoland/rev/a3ea83c0bad8
Add assert.positiveNumber to marionette, r=marionette-reviewers,whimboo,ato
https://hg.mozilla.org/integration/autoland/rev/d684a6d51c8a
Add print command to marionette, r=marionette-reviewers,whimboo,ato

(In reply to James Graham [:jgraham] from comment #5)

Turns out that kPaperSizeMillimeters resulted in a too-large surface on Mac, so I have a suspicion that it's using inches for the paper size there regardless.

As in you were seeing it be ~25x too large? Or a more general too large?

Flags: needinfo?(jwatt) → needinfo?(james)
Flags: needinfo?(jwatt)

I don't actually know how large it was but the error was about the surface exceeding the allocation limit [1] and changing the nsIPrintSettings object to use kPaperSizeInches and converting the input as required worked well.

[1] https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=281840228&repo=autoland&lineNumber=319643-319649

Flags: needinfo?(james)
Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla73
You need to log in before you can comment on or make changes to this bug.