Changes between Version 27 and Version 28 of Writing Layout Tests for DumpRenderTree


Ignore:
Timestamp:
Oct 27, 2011 5:12:03 PM (12 years ago)
Author:
jchaffraix@webkit.org
Comment:

how to write good test case (edit 3), how to tweak pixel / text dumping

Legend:

Unmodified
Added
Removed
Modified
  • Writing Layout Tests for DumpRenderTree

    v27 v28  
    158158  * add a 0 opacity to your text.
    159159
    160 '''Important note:''' For the 2 last points, the text will still be on the text render tree dump!
     160'''Important note:''' For the 2 last points, the text will still be on the text render tree dump! You can however disable the text dump if you don't need it, see below.
    161161
    162162If you test '''really needs to use some fonts''', make sure you use the ''Ahem'' font as it is a very portable font. Make sure to specify the font-height too not to depend on the platform (FIXME: not sure if this is really needed but better safe than sorry).
     
    166166Native controls cover anything that is painted by the OS. In WebKit, this means buttons, scroll bars, media players, ...
    167167
    168 You can use the previous tips for text here to hide your button if you don't need.
     168You can use the previous tips for text here to hide your button if you don't need it.
    169169
    170170For scroll bars, you just have to use the following rule in your CSS to disable them:
     
    173173overflow: hidden;
    174174}}}
     175
     176=== How to disable render tree dumps but keep the pixels ===
     177
     178If you want to just dump the pixels but don't care about DRT's text dump. You can use the following trick:
     179
     180{{{
     181if (window.layoutTestController)
     182    layoutTestController.dumpAsText(true);
     183}}}
     184
     185This is '''not''' a typo. It is an extremely confusing syntax but this disables the text dump (you dump an empty text file).
     186
     187=== How to disable the pixel dumps but keep the render tree dump ===
     188
     189There is currently no way for you to do that.
    175190
    176191= Writing JavaScript-based DOM-only Test Cases =