49 | | A good reading on how to write awesome test cases is the [http://www.w3.org/Style/CSS/Test/guidelines.html CSS2.1 Test Case Authoring Guidelines]. Especially read the ''section: 4. Writing ideal tests'' |
50 | | |
51 | | Now in the context of WebKit, test should at least indicate: |
52 | | * which bug it belongs to. That means the bug number or the bugzilla URL (better as you can paste it in a browser) but also the bug title to see what is tested. |
| 49 | A good reading on how to write awesome test cases is the [http://www.w3.org/Style/CSS/Test/guidelines.html CSS2.1 Test Case Authoring Guidelines]. Especially read the section: ''4. Writing ideal tests'' |
| 50 | |
| 51 | Now in the context of WebKit, a test should at least indicate: |
| 52 | * which bug it belongs to. That means the bug number or the bugzilla URL (the latter is better as you can paste it in a browser) but also the bug title to see what is tested. |
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. |
| 152 | Fonts are very dependent on the platform and the source of a lot of differences in our tests' output. That's because not all platform share the same fonts and the fallback mechanism is pretty much defined per machine as it depends on the OS and the available fonts! |
| 153 | |
| 154 | The golden rule for writing pixel tests is that '''if you can avoid text, you should'''. |
| 155 | |
| 156 | This seems against the previous section about writing understandable test cases and it is. However there are ways to put the information you need while keeping the portability of the no-text mantra: |
| 157 | |
| 158 | * put your information as comments in the HTML code (preferably somewhere prominent like the beginning) |
| 159 | * put your text outside of the dumped area: by default DumpRenderTree dumps a viewport of 600 * 800 pixels (FIXME: not 100% sure about the exact size). This means that anything outside this range would not be dumped in DRT but will appear in a browser opening the test if the resolution is sufficient. |
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. |
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). |
| 162 | '''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. |
| 163 | |
| 164 | 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). |