Closed Bug 967105 Opened 11 years ago Closed 5 years ago

No good way to test print renderings


(Testing :: Reftest, enhancement)

Not set


(Not tracked)



(Reporter: zwol, Unassigned)


(Blocks 1 open bug)


+++ This bug was initially created as a clone of Bug #844473 +++

It is difficult to write tests for details of the print rendering of a document, e.g. the presence or absence of margin boxes.  Quoting bug 844473 comment 11:

> Hmm, creating a test is quite complicate.
> moznomarginboxes influences the print settings when Print or PrintPreview
> gets called. (in a very odd way, and only then)
> Reftest assumes currently fixed settings, and directly uses
> setPageMode(true, ps).
> So header and footer would need to be enabled for the first part and
> PrintPreview mode somehow activated.
> For the reference page the settings would need to be reset to zero, and
> again PrintPreview mode activated, then comparing both. 
> Not sure how to write such code...
If anyone has any idea how this ought to work it would be dbaron.
Flags: needinfo?(dbaron)
No longer blocks: 743252
No longer depends on: 844473
Maybe there could be a way to have a way to select different print output "drivers" in FF?

One could be a simple image writer driven by the printer code. There is technical already code in each platform to create PDF Surfaces, only that on win32 you still need a working printer driver, because the PrintSettings depends on DevModes.

And then creating a new gfxImageSurface 

I think the whole nsPrintingSettings concept is a bit wrong. nsPrintingSettings should be platform independent, and internally call specific printer platform depending code. Much like the GFX Subsystem. So you can select on each platform "image writer" driver for test and a pdf writer without needing Win32 Printer Subsystem or GTK on linux.

The image data then could used to test output with a reference image.
Severity: normal → enhancement
Component: Print Preview → Reftest
OS: Windows 7 → All
Product: Core → Testing
Hardware: x86 → All

This bug has a stale needinfo from 6 years ago that's making it show up in the triage dashboard, so I want to something about it.

I don't know the history of printing/reftests that well but it seems like this bug is complaining about reftests not being able to test print layouts. However it looks like that feature was added in bug 1299848 (a few years after this bug was filed) and is documented here. So for now I'm going to close this bug as a duplicate, but if anybody has more information please feel free to chime in.

Closed: 5 years ago
Flags: needinfo?(dbaron)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.