[webkit-qt] printing unit tests

Milian Wolff milian.wolff at kdab.com
Wed Apr 11 11:05:39 PDT 2012

Hey all,

I'm interested in improving the printing support of the QtWebKit port.

I notice that a lot of unit tests are skipped and that apparently isPrinting() 
is not implemented/handled at all yet.

For quite some time now I'm trying to figure out what exactly would be 
required to get this done but it seems to be far from easy... Is there any 
documentation besides the chromium spagetthi test code on how the output 
should look like or when to output what (image, text, both, ...)?

As far as I can see, I will probably have to handle the isPrinting() mode in 
DumpRenderTreeQt.cpp ~ ::dump() in the if(m_dumpPixels) branch. Currently, 
that only paints the viewportSize() to an image. If I'm not mistaken, one 
needs to create a copy or QWebFrame::print, similar to chromiums' 
WebViewHost::paintPagesWithBoundaries. But what are the requirements on the 
output? Is there *any* documentation on what the tests should output?

Also, is it correct that such tests should be run with "--pixel-tests"? 

If I run e.g. 

python Tools/Scripts/new-run-webkit-tests LayoutTests/printing \
  --child-processes=1 --qt --verbose -p

this creates also images for tests which are not expected to create any images 
(like e.g. LayoutTests/printing/page-break-widows.html). How is this supposed 
to be handled, do the test bots know which test to run with with arguments? If 
I look at the TestShell.cpp code from chromium, I'm guessing that tests which 
output text should not output images (TestShell::dump -> 
shouldGeneratePixelResults) - do I interpret this correctly?

Milian Wolff | milian.wolff at kdab.com | Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel. Germany +49-30-521325470, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20120411/81e31a2f/attachment.bin>

More information about the webkit-qt mailing list