We use the WebKit project documentation as a reference guide for writing a reduced test case (http://webkit.org/quality/reduction.html). After reading the documentation on the WebKit site, refer to the tips and examples below for furthe
r help creating reduced test cases for Chromium.
- Using Chromium's Web inspector to understand the problem makes it easy to create a reduction.
- Get rid of unnecessary <div> and <a> tags.
- Replace <table> tags with <div> tags.
- If an issue has to do with overlaps or misalignment, add a border to the elements to see how they're being rendered.
- Remove images. If an issue doesn't relate to an image itself, remove the src value in the <image> tag, set height and width, and specify a border:
<img src="" width="70" height="70" style="border:1px solid red">
- With scripting issues, once the responsible scripts have been identified, check the path followed by different browsers and remove unnecessary functions and lines of code.
We've created a couple of examples that walk through the process of reducing a website bug into a reduced testcase.
- The edit-simplify method example takes an Orkut bug that we encountered in the past, and goes through a step-by-step process of reducing 500 lines of HTML code into 35 lines.
- Also useful is an example using Chromium's element inspector. Beginning with the same bug as the edit-simplify method, this example shows how to isolate the page element causing the issue.