144 | | * Do not use fonts other than those bundled with Mac OS X (usually there's no need to specify font families in a test). The only exception to this is the ''Ahem'' font. |
145 | | |
146 | | |
| 144 | The problem with a pixel dump is that it '''can be''' highly depend on the platform on which you run it. To be avoided to have more portable tests cases are the following: |
| 145 | * fonts |
| 146 | * native controls |
| 147 | |
| 148 | ==== Fonts ==== |
| 149 | |
| 150 | Fonts are very dependent on the platform and the source of a lot of differences in our tests. That's because not all platform share the same fonts and in this case, the fallback mechanism is pretty much defined per machine as it depends on the OS and the available fonts! |
| 151 | |
| 152 | The golden rule is that '''if you can avoid text, you should'''. |
| 153 | |
| 154 | This seems against the previous section about writing understandable test cases and it is. However there are a couple of ways to put the information you need while keeping the portability of the no-text mantra: |
| 155 | |
| 156 | * put your information as comments into the HTML |
| 157 | * put your text outside of the dumped area: by default DumpRenderTree dumps a viewport of 600 * 800 pixels (FIXME: not 100% sure about those numbers). This means that anything outside this range would not be dumped in DRT but will appear in a browser opening the test. |
| 158 | * add a 0 opacity to your text. |
| 159 | |
| 160 | '''Important note:''' For the 2 last points, the text will still be on the text render tree dump! |
| 161 | |
| 162 | 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 (FIXME: not sure if this is really needed but better safe than sorry). |
| 163 | |
| 164 | ==== Native controls ==== |
| 165 | |
| 166 | Native controls cover anything that is painted by the OS. In WebKit, this means buttons, scroll bars, media players, ... |
| 167 | |
| 168 | You can use the previous tips for text here to hide your button if you don't need. |
| 169 | |
| 170 | For scroll bars, you just have to use the following rule in your CSS to disable them: |
| 171 | |
| 172 | {{{ |
| 173 | overflow: hidden; |
| 174 | }}} |