Changes between Version 36 and Version 37 of Writing Layout Tests for DumpRenderTree
- Timestamp:
- May 31, 2012 1:55:58 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Writing Layout Tests for DumpRenderTree
v36 v37 143 143 As you can see, we did not need the pixels to get the information. The idea is that in this case, we were testing CSS and not the painting part of WebKit so querying the property directly would give us the result we need without having to dump the pixels. 144 144 145 === Couldn't you do a ref-test? === 146 147 Most test cases can be easily transformed into ref-tests and it is the preferred way to add new tests. See the dedicated page: [wiki:"Writing Reftests" Layout Tests: Writing Reftests] 148 145 149 === How to write portable pixel tests === 146 150 … … 163 167 '''Important note:''' For the 2 last points, the text will still be in the text render tree dump! You can however disable the text dump if you don't need it to achieve maximum portability, see below. 164 168 165 If 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 for that (FIXME: not sure if the font-size is really needed but better safe than sorry). 169 If you '''really need visible text in your pixel output''', there is a neat trick to make the output pretty cross-platform: 170 171 {{{ 172 html { 173 font: Ahem 10px; 174 -webkit-font-smoothing: none; 175 } 176 }}} 177 178 (It may be possible to not set the font-size but it's better to do it to ensure consistent behavior across platforms) 179 180 This ensures that all text in your page uses the Ahem font which renders the same on all platforms. Ahem has other nice properties so make sure you read up about it! Also note that your text will be unreadable so any instructions in the pixel output will be useless. 166 181 167 182 ==== Native controls ====